diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 | 
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-06 08:21:31 +0000 | 
| commit | 37f6c480c696a4a72c1701ee54624cc807aa80ba (patch) | |
| tree | 06d57bb7679a2140aef96db7105a0bd5f16a4358 /lib/CodeGen/CodeGenModule.cpp | |
| parent | 2659aeb5e51fe27d24bbffad0d1851b39fed5e43 (diff) | |
Notes
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 b69301ed5893..5c12c81b36be 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.  | 
