diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-17 19:47:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-17 19:47:21 +0000 |
commit | 48babfa60d3ee1854f33ad93e07abb2b22cf8ab8 (patch) | |
tree | 458718a60cbff364df0648407441fcd51f6e3e07 /lib/VMCore/Constants.cpp | |
parent | cb7a1eba4571f1efb472121f585b1dfcdea90bc7 (diff) |
The ConstantPointer class is now gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r-- | lib/VMCore/Constants.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 527eff5490..05bbef16b3 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -278,7 +278,7 @@ ConstantStruct::ConstantStruct(const StructType *T, } ConstantPointerRef::ConstantPointerRef(GlobalValue *GV) - : ConstantPointer(GV->getType()) { + : Constant(GV->getType()) { Operands.push_back(Use(GV, this)); } @@ -337,8 +337,15 @@ bool ConstantArray::classof(const Constant *CPV) { bool ConstantStruct::classof(const Constant *CPV) { return isa<StructType>(CPV->getType()) && !isa<ConstantExpr>(CPV); } -bool ConstantPointer::classof(const Constant *CPV) { - return (isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV)); + +bool ConstantPointerNull::classof(const Constant *CPV) { + return isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV) && + CPV->getNumOperands() == 0; +} + +bool ConstantPointerRef::classof(const Constant *CPV) { + return isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV) && + CPV->getNumOperands() == 1; } |