From bc22b5b3278b44e6ae4406ad6ac79f1cab731b0f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 May 2008 01:44:26 +0000 Subject: if a decl is both 'static' and weak or static and inline, its linkage type should be internal, not weak/linkonce. llvm-svn: 50611 --- clang/lib/CodeGen/CodeGenFunction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 1b94c595616..bacb610a50a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -159,14 +159,14 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD) { // TODO: Set up linkage and many other things. Note, this is a simple // approximation of what we really want. - if (FD->getAttr()) + if (FD->getStorageClass() == FunctionDecl::Static) + CurFn->setLinkage(llvm::Function::InternalLinkage); + else if (FD->getAttr()) CurFn->setLinkage(llvm::Function::DLLImportLinkage); else if (FD->getAttr()) CurFn->setLinkage(llvm::Function::DLLExportLinkage); else if (FD->getAttr() || FD->isInline()) CurFn->setLinkage(llvm::Function::WeakLinkage); - else if (FD->getStorageClass() == FunctionDecl::Static) - CurFn->setLinkage(llvm::Function::InternalLinkage); if (FD->getAttr()) CurFn->setCallingConv(llvm::CallingConv::Fast); -- cgit v1.2.3