summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-11-14 01:56:04 +0000
committerEric Christopher <echristo@gmail.com>2015-11-14 01:56:04 +0000
commit39db7260937be4ddbfc5f538a14146f43dc17299 (patch)
treeb668f558c71ddd836cc31f304349df1109febe3c /clang/lib/CodeGen/CGExpr.cpp
parent2cdcfd23cd019d40977006f6bee476442821a8b1 (diff)
downloadbcm5719-llvm-39db7260937be4ddbfc5f538a14146f43dc17299.tar.gz
bcm5719-llvm-39db7260937be4ddbfc5f538a14146f43dc17299.zip
Clarify and elaborate the conditions on which we're checking target
features for calls. llvm-svn: 253117
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 8b01094168e..a3f863fc0af 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -3748,10 +3748,12 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, llvm::Value *Callee,
"Call must have function pointer type!");
if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl))
- // If this isn't an always_inline function we can't guarantee that any
- // function isn't being used correctly so only check if we have the
- // attribute and a set of target attributes that might be different from
- // our default.
+ // We can only guarantee that a function is called from the correct
+ // context/function based on the appropriate target attributes,
+ // so only check in the case where we have both always_inline and target
+ // since otherwise we could be making a conditional call after a check for
+ // the proper cpu features (and it won't cause code generation issues due to
+ // function based code generation).
if (TargetDecl->hasAttr<AlwaysInlineAttr>() &&
TargetDecl->hasAttr<TargetAttr>())
checkTargetFeatures(E, FD);
OpenPOWER on IntegriCloud