diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-09-21 18:52:24 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-09-21 18:52:24 +0000 |
commit | 510d7c71e2d60f9b5f5ba1c5c1123e9d5cd0070e (patch) | |
tree | 26ed39340526bf87967b77e3831d6baa33b36ba4 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 8fb9b94f7f0d6598105cdece99649f307268ff7a (diff) | |
download | bcm5719-llvm-510d7c71e2d60f9b5f5ba1c5c1123e9d5cd0070e.tar.gz bcm5719-llvm-510d7c71e2d60f9b5f5ba1c5c1123e9d5cd0070e.zip |
Remove attributes minsize and optsize, which conflict with optnone.
This commit fixes an assert that is triggered when optnone is being
added to an IR function that is already marked with minsize and optsize.
rdar://problem/22723716
Differential Revision: http://reviews.llvm.org/D13004
llvm-svn: 248191
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 00121072dda..954fdab5679 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -827,10 +827,8 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, F->addFnAttr(llvm::Attribute::NoInline); // OptimizeNone wins over OptimizeForSize, MinSize, AlwaysInline. - assert(!F->hasFnAttribute(llvm::Attribute::OptimizeForSize) && - "OptimizeNone and OptimizeForSize on same function!"); - assert(!F->hasFnAttribute(llvm::Attribute::MinSize) && - "OptimizeNone and MinSize on same function!"); + F->removeFnAttr(llvm::Attribute::OptimizeForSize); + F->removeFnAttr(llvm::Attribute::MinSize); assert(!F->hasFnAttribute(llvm::Attribute::AlwaysInline) && "OptimizeNone and AlwaysInline on same function!"); |