Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: lib/CodeGen/CGBuiltin.cpp

Issue 7824006: [clang] Conditionally include target intrinsics, based on --enable-target Base URL: https://llvm.org/svn/llvm-project/cfe/trunk/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/CodeGen/CGExprScalar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/CodeGen/CGBuiltin.cpp
===================================================================
--- lib/CodeGen/CGBuiltin.cpp (revision 138929)
+++ lib/CodeGen/CGBuiltin.cpp (working copy)
@@ -1188,6 +1188,7 @@
Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
+#if defined(TARGET_ENABLED_ARM)
if (BuiltinID == ARM::BI__clear_cache) {
const FunctionDecl *FD = E->getDirectCallee();
// Oddly people write this call without args on occasion and gcc accepts
@@ -1918,6 +1919,10 @@
return SV;
}
}
+#else
+ assert(0 && "EmitARMBuiltinExpr w/out TARGET_ENABLED_ARM defined");
+#endif // TARGET_ENABLED_ARM
+ return 0;
}
llvm::Value *CodeGenFunction::
@@ -1949,6 +1954,7 @@
Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
+#if defined(TARGET_ENABLED_X86)
SmallVector<Value*, 4> Ops;
// Find out if any arguments are required to be integer constant expressions.
@@ -2348,10 +2354,15 @@
return Builder.CreateCall(F, Ops, name);
}
}
+#else
+ assert(0 && "EmitX86BuiltinExpr w/out TARGET_ENABLED_X86 defined!");
+#endif // defined(TARGET_ENABLED_X86)
+ return 0;
}
Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
+#if defined(TARGET_ENABLED_POWERPC)
SmallVector<Value*, 4> Ops;
for (unsigned i = 0, e = E->getNumArgs(); i != e; i++)
@@ -2437,5 +2448,9 @@
return Builder.CreateCall(F, Ops, "");
}
}
+#else
+ assert(0 && "EmitPPCBuiltinExpr w/out TARGET_ENABLED_POWERPC defined!");
+#endif // TARGET_ENABLED_POWERPC
+
return 0;
}
« no previous file with comments | « no previous file | lib/CodeGen/CGExprScalar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698