Add CommonLinkage to lto (treated same as weak AFAICT)

and llvm-nm (prints as C).

llvm-svn: 51209
This commit is contained in:
Dale Johannesen 2008-05-16 22:44:18 +00:00
parent 002f76dcec
commit 5da4b3ee8b
2 changed files with 4 additions and 1 deletions

View File

@ -70,6 +70,7 @@ namespace {
static char TypeCharForSymbol(GlobalValue &GV) {
if (GV.isDeclaration()) return 'U';
if (GV.hasLinkOnceLinkage()) return 'C';
if (GV.hasCommonLinkage()) return 'C';
if (GV.hasWeakLinkage()) return 'W';
if (isa<Function>(GV) && GV.hasInternalLinkage()) return 't';
if (isa<Function>(GV)) return 'T';

View File

@ -65,7 +65,7 @@ void LLVMSymbol::mayBeNotUsed() {
gv->setLinkage(GlobalValue::InternalLinkage);
}
// Map LLVM LinkageType to LTO LinakgeType
// Map LLVM LinkageType to LTO LinkageType
static LTOLinkageTypes
getLTOLinkageType(GlobalValue *v)
{
@ -76,6 +76,8 @@ getLTOLinkageType(GlobalValue *v)
lt = LTOLinkOnceLinkage;
else if (v->hasWeakLinkage())
lt = LTOWeakLinkage;
else if (v->hasCommonLinkage())
lt = LTOCommonLinkage;
else
// Otherwise it is internal linkage for link time optimizer
lt = LTOInternalLinkage;