mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-10 19:50:45 +00:00
It is totally unacceptable to print out (literally) millions of zeros when
compiling 129.compress... so don't! llvm-svn: 11649
This commit is contained in:
parent
85d76cb3d5
commit
b24f30de8d
@ -728,10 +728,21 @@ bool CWriter::doInitialization(Module &M) {
|
|||||||
// this, however, occurs when the variable has weak linkage. In this
|
// this, however, occurs when the variable has weak linkage. In this
|
||||||
// case, the assembler will complain about the variable being both weak
|
// case, the assembler will complain about the variable being both weak
|
||||||
// and common, so we disable this optimization.
|
// and common, so we disable this optimization.
|
||||||
if (!I->getInitializer()->isNullValue() ||
|
if (!I->getInitializer()->isNullValue()) {
|
||||||
I->hasWeakLinkage()) {
|
|
||||||
Out << " = " ;
|
Out << " = " ;
|
||||||
writeOperand(I->getInitializer());
|
writeOperand(I->getInitializer());
|
||||||
|
} else if (I->hasWeakLinkage()) {
|
||||||
|
// We have to specify an initializer, but it doesn't have to be
|
||||||
|
// complete. If the value is an aggregate, print out { 0 }, and let
|
||||||
|
// the compiler figure out the rest of the zeros.
|
||||||
|
Out << " = " ;
|
||||||
|
if (isa<StructType>(I->getInitializer()->getType()) ||
|
||||||
|
isa<ArrayType>(I->getInitializer()->getType())) {
|
||||||
|
Out << "{ 0 }";
|
||||||
|
} else {
|
||||||
|
// Just print it out normally.
|
||||||
|
writeOperand(I->getInitializer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user