From 8f477106a4a41b006c007c4e391c4bb8cca13347 Mon Sep 17 00:00:00 2001 From: Mon P Wang Date: Sat, 18 Oct 2008 02:49:28 +0000 Subject: [PATCH] Make llvm memory barrier available as an intrinsic llvm-svn: 57751 --- clang/include/clang/AST/Builtins.def | 4 ++++ clang/lib/AST/Builtins.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/clang/include/clang/AST/Builtins.def b/clang/include/clang/AST/Builtins.def index d23cc14eb92b..a2d54df18d40 100644 --- a/clang/include/clang/AST/Builtins.def +++ b/clang/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_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 diff --git a/clang/lib/AST/Builtins.cpp b/clang/lib/AST/Builtins.cpp index 3980d2052179..1823ee605596 100644 --- a/clang/lib/AST/Builtins.cpp +++ b/clang/lib/AST/Builtins.cpp @@ -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(); -- GitLab