mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-01 07:11:45 +00:00
don't send null pointers through the constantexpr codepath unneededly.
llvm-svn: 94010
This commit is contained in:
parent
2e8baf1561
commit
abaff06105
@ -1247,6 +1247,12 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
||||
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
|
||||
return EmitGlobalConstantVector(V, AddrSpace, *this);
|
||||
|
||||
if (isa<ConstantPointerNull>(CV)) {
|
||||
unsigned Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
|
||||
OutStreamer.EmitIntValue(0, Size, AddrSpace);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, it must be a ConstantExpr. Emit the data directive, then emit
|
||||
// the expression value.
|
||||
switch (TM.getTargetData()->getTypeAllocSize(CV->getType())) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user