[llvm-branch-commits] [llvm-branch] r134387 - /llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp
Chris Lattner
sabre at nondot.org
Mon Jul 4 14:11:29 PDT 2011
Author: lattner
Date: Mon Jul 4 16:11:29 2011
New Revision: 134387
URL: http://llvm.org/viewvc/llvm-project?rev=134387&view=rev
Log:
actually, rename error() -> emitError() to be more verbish
Modified:
llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp
Modified: llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp?rev=134387&r1=134386&r2=134387&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/Linker/LinkModules.cpp Mon Jul 4 16:11:29 2011
@@ -161,14 +161,15 @@
bool run();
private:
- /// error - Helper method for setting a message and returning an error code.
- bool error(const Twine &Message) {
+ /// emitError - Helper method for setting a message and returning an error
+ /// code.
+ bool emitError(const Twine &Message) {
ErrorMsg = Message.str();
return true;
}
- /// getLinkageResult - This analyzes the two global values and determines what
- /// the result will look like in the destination module.
+ /// getLinkageResult - This analyzes the two global values and determines
+ /// what the result will look like in the destination module.
bool getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
GlobalValue::LinkageTypes <, bool &LinkFromSrc);
@@ -254,7 +255,7 @@
LT = Src->getLinkage();
} else if (Src->hasAppendingLinkage() || Dest->hasAppendingLinkage()) {
if (Src->getLinkage() != Dest->getLinkage())
- return error("Linking globals named '" + Src->getName() +
+ return emitError("Linking globals named '" + Src->getName() +
"': can only link appending global with another appending global!");
LinkFromSrc = true; // Special cased.
LT = Src->getLinkage();
@@ -286,7 +287,7 @@
(Src->hasExternalLinkage() || Src->hasDLLImportLinkage() ||
Src->hasDLLExportLinkage() || Src->hasExternalWeakLinkage()) &&
"Unexpected linkage type!");
- return error("Linking globals named '" + Src->getName() +
+ return emitError("Linking globals named '" + Src->getName() +
"': symbol multiply defined!");
}
@@ -295,7 +296,7 @@
!Src->isDeclaration() && !Dest->isDeclaration() &&
!Src->hasAvailableExternallyLinkage() &&
!Dest->hasAvailableExternallyLinkage())
- return error("Linking globals named '" + Src->getName() +
+ return emitError("Linking globals named '" + Src->getName() +
"': symbols have different visibilities!");
return false;
}
@@ -312,20 +313,20 @@
// Check to see that they two arrays agree on type.
if (EltTy != SrcTy->getElementType())
- return error("Appending variables with different element types!");
+ return emitError("Appending variables with different element types!");
if (DstGV->isConstant() != SrcGV->isConstant())
- return error("Appending variables linked with different const'ness!");
+ return emitError("Appending variables linked with different const'ness!");
if (DstGV->getAlignment() != SrcGV->getAlignment())
- return error(
+ return emitError(
"Appending variables with different alignment need to be linked!");
if (DstGV->getVisibility() != SrcGV->getVisibility())
- return error(
+ return emitError(
"Appending variables with different visibility need to be linked!");
if (DstGV->getSection() != SrcGV->getSection())
- return error(
+ return emitError(
"Appending variables with different section name need to be linked!");
uint64_t NewSize = DstTy->getNumElements() + SrcTy->getNumElements();
@@ -445,7 +446,7 @@
if (LinkFromSrc) {
if (isa<GlobalAlias>(DGV))
- return error("Global-Alias Collision on '" + SGV->getName() +
+ return emitError("Global alias collision on '" + SGV->getName() +
"': symbol multiple defined");
// If the types don't match, and if we are to link from the source, nuke
@@ -501,7 +502,7 @@
// - SGV is external declaration, which is effectively a no-op.
// - SGV is weak, when we just need to throw SGV out.
if (!SGV->isDeclaration() && !SGV->isWeakForLinker())
- return error("Global-Alias Collision on '" + SGV->getName() +
+ return emitError("Global alias collision on '" + SGV->getName() +
"': symbol multiple defined");
}
@@ -571,7 +572,7 @@
if (LinkFromSrc) {
if (isa<GlobalAlias>(DGV))
- return error("Function-Alias Collision on '" + SF->getName() +
+ return emitError("Function alias collision on '" + SF->getName() +
"': symbol multiple defined");
// We have a definition of the same name but different type in the
@@ -612,7 +613,7 @@
// - SF is external declaration, which is effectively a no-op.
// - SF is weak, when we just need to throw SF out.
if (!SF->isDeclaration() && !SF->isWeakForLinker())
- return error("Function-Alias Collision on '" + SF->getName() +
+ return emitError("Function alias collision on '" + SF->getName() +
"': symbol multiple defined");
}
@@ -718,7 +719,7 @@
NewGA = DGA;
// Proceed to 'common' steps
} else
- return error("Alias Collision on '" + SGA->getName()+
+ return emitError("Alias collision on '" + SGA->getName()+
"': aliases have different aliasees");
} else if (GlobalVariable *DGVar = dyn_cast_or_null<GlobalVariable>(DGV)) {
// The only allowed way is to link alias with external declaration or weak
@@ -726,7 +727,7 @@
if (DGVar->isDeclaration() || DGVar->isWeakForLinker()) {
// But only if aliasee is global too...
if (!isa<GlobalVariable>(DAliasee))
- return error("Global-Alias Collision on '" + SGA->getName() +
+ return emitError("Global alias collision on '" + SGA->getName() +
"': aliasee is not global variable");
NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(),
@@ -747,7 +748,7 @@
// Proceed to 'common' steps
} else
- return error("Global-Alias Collision on '" + SGA->getName() +
+ return emitError("Global alias collision on '" + SGA->getName() +
"': symbol multiple defined");
} else if (Function *DF = dyn_cast_or_null<Function>(DGV)) {
// The only allowed way is to link alias with external declaration or weak
@@ -755,7 +756,7 @@
if (DF->isDeclaration() || DF->isWeakForLinker()) {
// But only if aliasee is function too.
if (!isa<Function>(DAliasee))
- return error("Function-Alias Collision on '" + SGA->getName() +
+ return emitError("Function alias collision on '" + SGA->getName() +
"': aliasee is not function");
NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(),
@@ -775,7 +776,7 @@
// Proceed to 'common' steps
} else
- return error("Function-Alias Collision on '" + SGA->getName() +
+ return emitError("Function alias collision on '" + SGA->getName() +
"': symbol multiple defined");
} else {
// No linking to be performed, simply create an identical version of the
More information about the llvm-branch-commits
mailing list