[llvm-commits] CVS: llvm/include/llvm/GlobalVariable.h

Lauro Ramos Venancio lauro.venancio at gmail.com
Thu Apr 12 11:33:32 PDT 2007



Changes in directory llvm/include/llvm:

GlobalVariable.h updated: 1.39 -> 1.40
---
Log message:

Implement the "thread_local" keyword.


---
Diffs of the changes:  (+7 -2)

 GlobalVariable.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/GlobalVariable.h
diff -u llvm/include/llvm/GlobalVariable.h:1.39 llvm/include/llvm/GlobalVariable.h:1.40
--- llvm/include/llvm/GlobalVariable.h:1.39	Tue Jan 30 14:08:38 2007
+++ llvm/include/llvm/GlobalVariable.h	Thu Apr 12 13:32:50 2007
@@ -44,6 +44,7 @@
   void setPrev(GlobalVariable *N) { Prev = N; }
 
   bool isConstantGlobal;               // Is this a global constant?
+  bool isThreadLocalSymbol;            // Is this symbol "Thread Local"?
   Use Initializer;
 
 public:
@@ -51,12 +52,12 @@
   /// automatically inserted into the end of the specified modules global list.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer = 0, const std::string &Name = "",
-                 Module *Parent = 0);
+                 Module *Parent = 0, bool ThreadLocal = false);
   /// GlobalVariable ctor - This creates a global and inserts it before the
   /// specified other global.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer, const std::string &Name,
-                 GlobalVariable *InsertBefore);
+                 GlobalVariable *InsertBefore, bool ThreadLocal = false);
   
   /// isDeclaration - Is this global variable lacking an initializer?  If so, 
   /// the global variable is defined in some other translation unit, and is thus
@@ -107,6 +108,10 @@
   bool isConstant() const { return isConstantGlobal; }
   void setConstant(bool Value) { isConstantGlobal = Value; }
 
+  /// If the value is "Thread Local", its value isn't shared by the threads.
+  bool isThreadLocal() const { return isThreadLocalSymbol; }
+  void setThreadLocal(bool Value) { isThreadLocalSymbol = Value; }
+
   /// removeFromParent - This method unlinks 'this' from the containing module,
   /// but does not delete it.
   ///






More information about the llvm-commits mailing list