diff options
author | ed <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 |
commit | 265c92560db8af7e64dc328cb612076086a62bd1 (patch) | |
tree | 06d57bb7679a2140aef96db7105a0bd5f16a4358 /lib/CodeGen/CodeGenModule.cpp | |
parent | 9e262ca77e924f9d84a864b031a1b931d03c5e38 (diff) | |
download | FreeBSD-src-265c92560db8af7e64dc328cb612076086a62bd1.zip FreeBSD-src-265c92560db8af7e64dc328cb612076086a62bd1.tar.gz |
Import clang, at r72995.
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index b69301e..5c12c81 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -298,7 +298,7 @@ void CodeGenModule::SetFunctionDefinitionAttributes(const FunctionDecl *D, GV->setLinkage(llvm::Function::InternalLinkage); } else if (D->hasAttr<DLLExportAttr>()) { GV->setLinkage(llvm::Function::DLLExportLinkage); - } else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>()) { + } else if (D->hasAttr<WeakAttr>()) { GV->setLinkage(llvm::Function::WeakAnyLinkage); } else if (Linkage == GVA_C99Inline) { // In C99 mode, 'inline' functions are guaranteed to have a strong @@ -853,7 +853,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { GV->setLinkage(llvm::Function::DLLImportLinkage); else if (D->hasAttr<DLLExportAttr>()) GV->setLinkage(llvm::Function::DLLExportLinkage); - else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>()) + else if (D->hasAttr<WeakAttr>()) GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); else if (!CompileOpts.NoCommon && (!D->hasExternalStorage() && !D->getInit())) @@ -891,8 +891,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, for (llvm::Value::use_iterator UI = OldFn->use_begin(), E = OldFn->use_end(); UI != E; ) { // TODO: Do invokes ever occur in C code? If so, we should handle them too. + unsigned OpNo = UI.getOperandNo(); llvm::CallInst *CI = dyn_cast<llvm::CallInst>(*UI++); - if (!CI) continue; + if (!CI || OpNo != 0) continue; // If the return types don't match exactly, and if the call isn't dead, then // we can't transform this call. |