Fixed 'inline' lossage --flo
[libfirm] / firmjni / Dbginfo.c
index 5e11134..7f19e7e 100644 (file)
@@ -1,19 +1,18 @@
-/**
- * @file firmjni/Dbginfo.cc
- *
- *
- *
- * @author   Goetz Lindenmaier
- * CVS-ID:   $Id$
- * Copyright (c) 2003 University of Karlsruhe
- * Created:  26.2.2003
- * Project:  Recoder frontend for libfirm
- *
- *
+/*
+ * Project:     libFIRM / Recoder frontend for libFIRM
+ * File name:   firmjni/Dbginfo.c
+ * Purpose:     Testing callback.
+ * Author:      Goetz Lindenmaier
+ * Modified by:
+ * Created:     26.2.2003
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 2003 Universität Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
-#include "Dbginfo.h"
 
-#include <firm.h>
+#include "Dbginfo.h"   /* Generated. */
+
+#include "firm.h"
 #include "dbginfo.h"
 #include <stdio.h>
 
@@ -22,6 +21,11 @@ static jmethodID sets_id;
 static JNIEnv   *my_env_jni_;
 static jclass    my_cls_jni_;
 
+struct dbg_info
+{
+  int idx;
+};
+
 static void
 my_dbg_info_merge_pair(ir_node *nw, ir_node *old, dbg_action info) {
   if (pair_id) {
@@ -55,3 +59,40 @@ void Java_firmjni_Dbginfo_dbgInit (JNIEnv *env_jni_, jclass cls_jni_) {
 
   dbg_init(&my_dbg_info_merge_pair, &my_dbg_info_merge_sets);
 }
+
+/** Return the dbg object index of the given node. A new dbg object is created, if needed. */
+jint Java_firmjni_Dbginfo_getDbgInfoIdx (JNIEnv *env, jclass clss, jint jnode)
+{
+  /*
+  ir_node *node = (ir_node*) jnode;
+
+  dbg_info *info = get_irn_dbg_info (node);
+
+  if (0 == info) {
+       info = get_dbg_info ();
+       set_irn_dbg_info (node, info);
+  }
+
+  return (info->idx);
+  */
+
+  return (0);
+}
+
+/** Return the dbg object index of the given node, or <TT>-1</TT> if none has been set. */
+jint Java_firmjni_Dbginfo_doGetDbgInfoIdx (JNIEnv *env, jclass clss, jint jnode)
+{
+  /*
+  ir_node *node = (ir_node*) jnode;
+
+  dbg_info *info = get_irn_dbg_info (node);
+
+  if (0 == info) {
+       return (-1);
+  }
+
+  return (info->idx);
+  */
+
+  return (0);
+}