Make llvm memory barrier available as an intrinsic


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57751 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Builtins.def b/include/clang/AST/Builtins.def
index d23cc14..a2d54df 100644
--- a/include/clang/AST/Builtins.def
+++ b/include/clang/AST/Builtins.def
@@ -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
diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp
index 3980d20..1823ee6 100644
--- a/lib/AST/Builtins.cpp
+++ b/lib/AST/Builtins.cpp
@@ -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();