[cfe-commits] r57751 - in /cfe/trunk: include/clang/AST/Builtins.def lib/AST/Builtins.cpp

Mon P Wang wangmp at apple.com
Fri Oct 17 19:49:28 PDT 2008


Author: wangmp
Date: Fri Oct 17 21:49:28 2008
New Revision: 57751

URL: http://llvm.org/viewvc/llvm-project?rev=57751&view=rev
Log:
Make llvm memory barrier available as an intrinsic

Modified:
    cfe/trunk/include/clang/AST/Builtins.def
    cfe/trunk/lib/AST/Builtins.cpp

Modified: cfe/trunk/include/clang/AST/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Builtins.def?rev=57751&r1=57750&r2=57751&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Builtins.def (original)
+++ cfe/trunk/include/clang/AST/Builtins.def Fri Oct 17 21:49:28 2008
@@ -24,6 +24,7 @@
 // The second value provided to the macro specifies the type of the function
 // (result value, then each argument) as follows:
 //  v -> void
+//  b -> boolean
 //  c -> char
 //  s -> short
 //  i -> int
@@ -165,4 +166,7 @@
 BUILTIN(__sync_lock_test_and_set,"ii*i", "n")
 BUILTIN(__sync_val_compare_and_swap,"ii*ii", "n")
 
+// LLVM instruction builtin
+BUILTIN(__builtin_llvm_memory_barrier,"vbbbbb", "n")
+
 #undef BUILTIN

Modified: cfe/trunk/lib/AST/Builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Builtins.cpp?rev=57751&r1=57750&r2=57751&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Builtins.cpp (original)
+++ cfe/trunk/lib/AST/Builtins.cpp Fri Oct 17 21:49:28 2008
@@ -127,6 +127,10 @@
     else
       Type = Context.CharTy;
     break;
+  case 'b': // boolean
+    assert(!Long && !Signed && !Unsigned && "Bad modifiers for 'b'!");
+    Type = Context.BoolTy;
+    break;
   case 'z':  // size_t.
     assert(!Long && !Signed && !Unsigned && "Bad modifiers for 'z'!");
     Type = Context.getSizeType();





More information about the cfe-commits mailing list