[llvm-commits] [gcc-plugin] r75355 - in /gcc-plugin/trunk: bits_and_bobs.h llvm-convert.cpp

Duncan Sands baldrick at free.fr
Fri Jul 10 21:28:55 PDT 2009


Author: baldrick
Date: Fri Jul 10 23:28:55 2009
New Revision: 75355

URL: http://llvm.org/viewvc/llvm-project?rev=75355&view=rev
Log:
Add a header declaring various bits and pieces
that are needed but have not yet found a home.

Added:
    gcc-plugin/trunk/bits_and_bobs.h
Modified:
    gcc-plugin/trunk/llvm-convert.cpp

Added: gcc-plugin/trunk/bits_and_bobs.h
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/bits_and_bobs.h?rev=75355&view=auto

==============================================================================
--- gcc-plugin/trunk/bits_and_bobs.h (added)
+++ gcc-plugin/trunk/bits_and_bobs.h Fri Jul 10 23:28:55 2009
@@ -0,0 +1,29 @@
+// Place to keep various things that will need to be sorted out someday.
+#ifndef BITS_AND_BOBS_H
+#define BITS_AND_BOBS_H
+
+union tree_node;
+
+namespace llvm { class Value; }
+
+extern void llvm_set_decl (union tree_node *, Value *);
+extern Value *llvm_get_decl(union tree_node *);
+#define DECL_LLVM(NODE) (llvm_get_decl(NODE))
+#define SET_DECL_LLVM(NODE, LLVM) (llvm_set_decl (NODE,LLVM))
+
+/* Returns nonzero if the DECL_LLVM for NODE has already been set.  */
+extern bool llvm_set_decl_p(union tree_node *);
+#define DECL_LLVM_SET_P(NODE) (HAS_RTL_P (NODE) && llvm_set_decl_p(NODE))
+
+/* The DECL_LLVM for NODE, if it is set, or NULL, if it is not set.  */
+#define DECL_LLVM_IF_SET(NODE) \
+  (DECL_LLVM_SET_P (NODE) ? DECL_LLVM (NODE) : NULL)
+
+// emit_global_to_llvm - Emit the specified VAR_DECL to LLVM as a global
+// variable.
+// FIXME: Should not be here
+void emit_global_to_llvm(union tree_node*);
+
+extern bool flag_odr;
+
+#endif

Modified: gcc-plugin/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=75355&r1=75354&r2=75355&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Fri Jul 10 23:28:55 2009
@@ -77,6 +77,7 @@
 #include "llvm-abi.h"
 #include "llvm-internal.h"
 #include "llvm-debug.h"
+#include "bits_and_bobs.h"
 
 // Check for GCC bug 17347: C++ FE sometimes creates bogus ctor trees
 // which we should throw out





More information about the llvm-commits mailing list