summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-10-29 12:32:58 +0000
committerTim Northover <tnorthover@apple.com>2013-10-29 12:32:58 +0000
commit58d2bb12ff546c6e5845fc87b554fcc276052a84 (patch)
tree7e7661c776bc03bcf545ac4cdc0aa57f3bc04d0d /clang/lib
parentedc5f0917564bd332099debc410aa52345230e0a (diff)
downloadbcm5719-llvm-58d2bb12ff546c6e5845fc87b554fcc276052a84.tar.gz
bcm5719-llvm-58d2bb12ff546c6e5845fc87b554fcc276052a84.zip
ARM: fix AST for __builtin_arm_strex call
The AST was constructed so that this builtin returned the default BoolTy and since I'd opted for custom SemaChecking, I should have set it properly at that point. This caused an assertion failure when the types didn't match up with what we generated. This makes it return an IntTy, which is as good as anything. llvm-svn: 193606
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index fd3bce2819c..aa9ba2c8e68 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -556,8 +556,11 @@ bool Sema::CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall) {
ValArg = PerformCopyInitialization(Entity, SourceLocation(), ValArg);
if (ValArg.isInvalid())
return true;
-
TheCall->setArg(0, ValArg.get());
+
+ // __builtin_arm_strex always returns an int. It's marked as such in the .def,
+ // but the custom checker bypasses all default analysis.
+ TheCall->setType(Context.IntTy);
return false;
}
OpenPOWER on IntegriCloud