diff options
author | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-12-15 18:57:28 +0000 |
---|---|---|
committer | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-12-15 18:57:28 +0000 |
commit | 30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75 (patch) | |
tree | 0ee33016bac3c92c95642f9566df6abbba07e0d3 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | addddc441f9c7fbd4ed70bc5a3256c385599929d (diff) | |
download | bcm5719-llvm-30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75.tar.gz bcm5719-llvm-30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75.zip |
Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.
llvm-svn: 224256
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 06467fda6ef..87bd955a6c0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -769,9 +769,10 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, // OptimizeNone wins over OptimizeForSize, MinSize, AlwaysInline. assert(!F->hasFnAttribute(llvm::Attribute::OptimizeForSize) && "OptimizeNone and OptimizeForSize on same function!"); - // FIXME: Change these to asserts. - F->removeFnAttr(llvm::Attribute::MinSize); - F->removeFnAttr(llvm::Attribute::AlwaysInline); + assert(!F->hasFnAttribute(llvm::Attribute::MinSize) && + "OptimizeNone and MinSize on same function!"); + assert(!F->hasFnAttribute(llvm::Attribute::AlwaysInline) && + "OptimizeNone and AlwaysInline on same function!"); // Attribute 'inlinehint' has no effect on 'optnone' functions. // Explicitly remove it from the set of function attributes. |