projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f958dd2
)
don't send null pointers through the constantexpr codepath unneededly.
author
Chris Lattner
<sabre@nondot.org>
Wed, 20 Jan 2010 17:57:50 +0000
(17:57 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 20 Jan 2010 17:57:50 +0000
(17:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94010
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 4c5e079f03be2a928ddb75e602efe98a48af9e09..32e9036af94f74a83385957141e4c76677a563fa 100644
(file)
--- a/
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@
-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())) {