summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-26 23:18:33 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-26 23:18:33 +0000
commit0120ee792c3a07fb92f8f5ec1e3be0bcf5370c60 (patch)
tree2e463db3302f29c11e82efaee5557411107d4076 /clang/lib/CodeGen/CGCall.cpp
parent846c6f0a329c2ffc371d8426fd5b7f9e11fa3412 (diff)
downloadbcm5719-llvm-0120ee792c3a07fb92f8f5ec1e3be0bcf5370c60.tar.gz
bcm5719-llvm-0120ee792c3a07fb92f8f5ec1e3be0bcf5370c60.zip
Temporarily revert r176133 until testcases are modified.
llvm-svn: 176137
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 3bcf7d0f50a..33b0475c564 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1021,6 +1021,19 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
// Attributes that should go on the call site only.
if (!CodeGenOpts.SimplifyLibCalls)
FuncAttrs.addAttribute(llvm::Attribute::NoBuiltin);
+ } else {
+ // Attributes that should go on the function, but not the call site.
+ if (!TargetOpts.CPU.empty())
+ FuncAttrs.addAttribute("target-cpu", TargetOpts.CPU);
+
+ if (TargetOpts.Features.size()) {
+ llvm::SubtargetFeatures Features;
+ for (std::vector<std::string>::const_iterator
+ it = TargetOpts.Features.begin(),
+ ie = TargetOpts.Features.end(); it != ie; ++it)
+ Features.AddFeature(*it);
+ FuncAttrs.addAttribute("target-features", Features.getString());
+ }
}
QualType RetTy = FI.getReturnType();
OpenPOWER on IntegriCloud