diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-02-22 16:59:24 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-02-22 16:59:24 +0000 |
commit | 7c19ab17c722288f47dfc887dec0405814bf304d (patch) | |
tree | a90abcc93e28e1d24c4025be0d2ba931b264d6c5 /clang/lib/CodeGen/CGCall.cpp | |
parent | 9d2c15eff7edd220a3246ebedd2e502051e49844 (diff) | |
download | bcm5719-llvm-7c19ab17c722288f47dfc887dec0405814bf304d.tar.gz bcm5719-llvm-7c19ab17c722288f47dfc887dec0405814bf304d.zip |
Exposing the noduplicate attribute within Clang, which marks functions so that the optimizer does not duplicate code.
Patch thanks to Marcello Maggioni!
llvm-svn: 201941
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index a9caa88706a..a21e4783b60 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1052,6 +1052,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); if (TargetDecl->hasAttr<NoReturnAttr>()) FuncAttrs.addAttribute(llvm::Attribute::NoReturn); + if (TargetDecl->hasAttr<NoDuplicateAttr>()) + FuncAttrs.addAttribute(llvm::Attribute::NoDuplicate); if (const FunctionDecl *Fn = dyn_cast<FunctionDecl>(TargetDecl)) { const FunctionProtoType *FPT = Fn->getType()->getAs<FunctionProtoType>(); |