[llvm-commits] CVS: llvm/include/llvm/Support/IncludeFile.h

Reid Spencer reid at x10sys.com
Wed Jun 7 15:00:42 PDT 2006



Changes in directory llvm/include/llvm/Support:

IncludeFile.h updated: 1.2 -> 1.3
---
Log message:

For PR780: http://llvm.cs.uiuc.edu/PR780 :
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.


---
Diffs of the changes:  (+5 -3)

 IncludeFile.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Support/IncludeFile.h
diff -u llvm/include/llvm/Support/IncludeFile.h:1.2 llvm/include/llvm/Support/IncludeFile.h:1.3
--- llvm/include/llvm/Support/IncludeFile.h:1.2	Wed Jun  7 15:35:46 2006
+++ llvm/include/llvm/Support/IncludeFile.h	Wed Jun  7 17:00:26 2006
@@ -27,13 +27,15 @@
 /// And, foo.cp would use:<br/>
 /// <tt>DEFINING_FILE_FOR(foo)</tt><br/>
 #define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \
-  extern char name ## LinkVar; \
-  static IncludeFile name ## LinkObj ( &name ## LinkVar )
+  namespace llvm { \
+    extern char name ## LinkVar; \
+    static IncludeFile name ## LinkObj ( &name ## LinkVar ); \
+  } 
 
 /// This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should
 /// be used in a .cpp file to define the name referenced in a header file that
 /// will cause linkage of the .cpp file. It should only be used at extern level.
-#define DEFINING_FILE_FOR(name) char name
+#define DEFINING_FILE_FOR(name) namespace llvm { char name ## LinkVar; }
 
 namespace llvm {
 






More information about the llvm-commits mailing list