mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +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))
|
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
|
||||||
return EmitGlobalConstantVector(V, AddrSpace, *this);
|
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
|
// Otherwise, it must be a ConstantExpr. Emit the data directive, then emit
|
||||||
// the expression value.
|
// the expression value.
|
||||||
switch (TM.getTargetData()->getTypeAllocSize(CV->getType())) {
|
switch (TM.getTargetData()->getTypeAllocSize(CV->getType())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user