aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index adf5ac2e41..5ef57ffdcc 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -325,7 +325,9 @@ void CodeGenModule::SetFunctionAttributes(const Decl *D,
static CodeGenModule::GVALinkage
GetLinkageForFunctionOrMethodDecl(const Decl *D) {
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- if (FD->getStorageClass() == FunctionDecl::Static)
+ // "static" and attr(always_inline) functions get internal linkage.
+ if (FD->getStorageClass() == FunctionDecl::Static ||
+ FD->hasAttr<AlwaysInlineAttr>())
return CodeGenModule::GVA_Internal;
if (FD->isInline()) {
if (FD->getStorageClass() == FunctionDecl::Extern)