diff options
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 | ||||
-rw-r--r-- | clang/test/CodeGen/attr-noinline.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ae472f01ce6..3d01770cd3a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -339,6 +339,9 @@ void CodeGenModule::SetFunctionAttributesForDefinition(const Decl *D, if (D->getAttr<AlwaysInlineAttr>()) F->addFnAttr(llvm::Attribute::AlwaysInline); + + if (D->getAttr<NoinlineAttr>()) + F->addFnAttr(llvm::Attribute::NoInline); } void CodeGenModule::SetMethodAttributes(const ObjCMethodDecl *MD, diff --git a/clang/test/CodeGen/attr-noinline.c b/clang/test/CodeGen/attr-noinline.c new file mode 100644 index 00000000000..5aacf64a944 --- /dev/null +++ b/clang/test/CodeGen/attr-noinline.c @@ -0,0 +1,9 @@ +// RUN: clang -g -emit-llvm -o %t %s && +// RUN: grep 'noinline' %t + +void t1() __attribute__((noinline)); + +void t1() +{ +} + |