]> granicus.if.org Git - clang/commitdiff
Make llvm memory barrier available as an intrinsic
authorMon P Wang <wangmp@apple.com>
Sat, 18 Oct 2008 02:49:28 +0000 (02:49 +0000)
committerMon P Wang <wangmp@apple.com>
Sat, 18 Oct 2008 02:49:28 +0000 (02:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57751 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Builtins.def
lib/AST/Builtins.cpp

index d23cc14eb92b2f62389f74c02bbd4fc098999ad4..a2d54df18d4061d545863eddff43424553eeb0ff 100644 (file)
@@ -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_fetch_and_xor,"ii*i", "n")
 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
index 3980d205217973db5519952228344d2396baa773..1823ee6055962a769c117be0d7c647b573d7f913 100644 (file)
@@ -127,6 +127,10 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context,
     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();