diff options
author | Eric Christopher <echristo@gmail.com> | 2015-10-15 23:47:11 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-10-15 23:47:11 +0000 |
commit | 15709991d09d940834029baf20a078d44f55234a (patch) | |
tree | 30185b97f8eb0a29fa9fd46df53f4f7bd34963a0 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | a15785bb5b644d92ea27b247d01be4f87b46307c (diff) | |
download | llvm-15709991d09d940834029baf20a078d44f55234a.zip llvm-15709991d09d940834029baf20a078d44f55234a.tar.gz llvm-15709991d09d940834029baf20a078d44f55234a.tar.bz2 |
Add an error when calling a builtin that requires features that don't
match the feature set of the function that they're being called from.
This ensures that we can effectively diagnose some[1] code that would
instead ICE in the backend with a failure to select message.
Example:
__m128d foo(__m128d a, __m128d b) {
return __builtin_ia32_addsubps(b, a);
}
compiled for normal x86_64 via:
clang -target x86_64-linux-gnu -c
would fail to compile in the back end because the normal subtarget
features for x86_64 only include sse2 and the builtin requires sse3.
[1] We're still not erroring on:
__m128i bar(__m128i const *p) { return _mm_lddqu_si128(p); }
where we should fail and error on an always_inline function being
inlined into a function that doesn't support the subtarget features
required.
llvm-svn: 250473
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 390e346..d67e6f6 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2633,6 +2633,8 @@ public: RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue = ReturnValueSlot()); + bool checkBuiltinTargetFeatures(const FunctionDecl *TargetDecl); + llvm::CallInst *EmitRuntimeCall(llvm::Value *callee, const Twine &name = ""); llvm::CallInst *EmitRuntimeCall(llvm::Value *callee, |