summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-09 06:14:31 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-09 06:14:31 +0000
commit52796e819fa3dd61f9513c71a94433ee7ba35a76 (patch)
tree5ff7574c576b36517c873af820b370d726ba1296 /llvm/lib/Bytecode/Writer/SlotCalculator.cpp
parente76289b8eacea3a13ba5bfc29c562f16ee947e3e (diff)
downloadbcm5719-llvm-52796e819fa3dd61f9513c71a94433ee7ba35a76.tar.gz
bcm5719-llvm-52796e819fa3dd61f9513c71a94433ee7ba35a76.zip
For PR1146:
Use ParamAttrsList for writing parameter attributes. Since they are sparse now, we also write them sparsely (saves a few bytes). Unfortunately, this is a bytecode file format change. llvm-svn: 35811
Diffstat (limited to 'llvm/lib/Bytecode/Writer/SlotCalculator.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/SlotCalculator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
index 43ad922e2b7..85ccad58c5b 100644
--- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
@@ -332,6 +332,10 @@ void SlotCalculator::purgeFunction() {
SC_DEBUG("end purgeFunction!\n");
}
+inline static bool hasImplicitNull(const Type* Ty) {
+ return Ty != Type::LabelTy && Ty != Type::VoidTy && !isa<OpaqueType>(Ty);
+}
+
void SlotCalculator::CreateFunctionValueSlot(const Value *V) {
assert(!NodeMap.count(V) && "Function-local value can't be inserted!");
@@ -353,7 +357,7 @@ void SlotCalculator::CreateFunctionValueSlot(const Value *V) {
// to insert the implicit null value.
if (Table[TyPlane].empty()) {
// Label's and opaque types can't have a null value.
- if (Ty != Type::LabelTy && !isa<OpaqueType>(Ty)) {
+ if (hasImplicitNull(Ty)) {
Value *ZeroInitializer = Constant::getNullValue(Ty);
// If we are pushing zeroinit, it will be handled below.
@@ -370,5 +374,4 @@ void SlotCalculator::CreateFunctionValueSlot(const Value *V) {
SC_DEBUG(" Inserting value [" << TyPlane << "] = " << *V << " slot=" <<
NodeMap[V] << "\n");
-}
-
+}
OpenPOWER on IntegriCloud