mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Rename getNullPointer to getNull
Allow sharing of null pointer constants git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,7 +46,7 @@ ConstPoolVal *ConstPoolVal::getNullConstant(const Type *Ty) {
|
|||||||
case Type::DoubleTyID: return ConstPoolFP::get(Ty, 0);
|
case Type::DoubleTyID: return ConstPoolFP::get(Ty, 0);
|
||||||
|
|
||||||
case Type::PointerTyID:
|
case Type::PointerTyID:
|
||||||
return ConstPoolPointer::getNullPointer(cast<PointerType>(Ty));
|
return ConstPoolPointer::getNull(cast<PointerType>(Ty));
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -331,3 +331,15 @@ ConstPoolStruct *ConstPoolStruct::get(const StructType *Ty,
|
|||||||
StructConstants.add(Ty, V, Result = new ConstPoolStruct(Ty, V));
|
StructConstants.add(Ty, V, Result = new ConstPoolStruct(Ty, V));
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---- ConstPoolPointer::get() implementation...
|
||||||
|
//
|
||||||
|
static ValueMap<char, ConstPoolPointer> NullPtrConstants;
|
||||||
|
|
||||||
|
ConstPoolPointer *ConstPoolPointer::getNull(const PointerType *Ty) {
|
||||||
|
ConstPoolPointer *Result = NullPtrConstants.get(Ty, 0);
|
||||||
|
if (!Result) // If no preexisting value, create one now...
|
||||||
|
NullPtrConstants.add(Ty, 0, Result = new ConstPoolPointer(Ty));
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user