forked from OSchip/llvm-project
Bug fix: need to use .reserve for uninitialized data.
llvm-svn: 1205
This commit is contained in:
parent
7a3c4070d6
commit
56e61ec517
|
@ -438,7 +438,7 @@ SparcAsmPrinter::printConstant(const ConstPoolVal* CV, string valID)
|
||||||
if (! CPP->isNullValue())
|
if (! CPP->isNullValue())
|
||||||
assert(0 && "Cannot yet print non-null pointer constants to assembly");
|
assert(0 && "Cannot yet print non-null pointer constants to assembly");
|
||||||
else
|
else
|
||||||
toAsm << (void*) NULL;
|
toAsm << (void*) NULL << endl;
|
||||||
}
|
}
|
||||||
else if (ConstPoolPointerRef* CPRef = dyn_cast<ConstPoolPointerRef>(CV))
|
else if (ConstPoolPointerRef* CPRef = dyn_cast<ConstPoolPointerRef>(CV))
|
||||||
{
|
{
|
||||||
|
@ -464,11 +464,10 @@ SparcAsmPrinter::printGlobalVariable(const GlobalVariable* GV)
|
||||||
if (GV->hasInitializer())
|
if (GV->hasInitializer())
|
||||||
printConstant(GV->getInitializer(), getID(GV));
|
printConstant(GV->getInitializer(), getID(GV));
|
||||||
else {
|
else {
|
||||||
toAsm << "\t.align" << TypeToAlignment(GV->getType()->getValueType(), Target)
|
toAsm << "\t.align\t"
|
||||||
<< getID(GV) << ":" << endl;
|
<< TypeToAlignment(GV->getType()->getValueType(), Target) << endl;
|
||||||
|
toAsm << "\t.type\t" << getID(GV) << ",#object" << endl;
|
||||||
toAsm << "\t.type" << "\t" << getID(GV) << ",#object" << endl;
|
toAsm << "\t.reserve\t" << getID(GV) << ","
|
||||||
toAsm << "\t.size" << "\t" << getID(GV) << ","
|
|
||||||
<< TypeToSize(GV->getType()->getValueType(), Target)
|
<< TypeToSize(GV->getType()->getValueType(), Target)
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue