Mark inlined functions as having static linkage

This commit is contained in:
Matt Pharr
2011-10-07 16:06:14 -07:00
parent ce7355f9ed
commit 6009608bc6

View File

@@ -251,7 +251,8 @@ Function::InitFunctionSymbol(DeclSpecs *ds, Declarator *decl) {
return NULL;
// And create the llvm::Function
llvm::GlobalValue::LinkageTypes linkage = ds->storageClass == SC_STATIC ?
llvm::GlobalValue::LinkageTypes linkage = (ds->storageClass == SC_STATIC ||
(ds->typeQualifier & TYPEQUAL_INLINE)) ?
llvm::GlobalValue::InternalLinkage : llvm::GlobalValue::ExternalLinkage;
std::string functionName = ((ds->storageClass == SC_EXTERN_C) ?
funSym->name : funSym->MangledName());