GlobalValue is always pointer type, so an assert isn't required.

llvm-svn: 70300
This commit is contained in:
Sanjiv Gupta 2009-04-28 16:39:45 +00:00
parent d2b7be6e9b
commit 7bfed8a9f4
1 changed files with 1 additions and 6 deletions

View File

@ -483,13 +483,8 @@ bool PIC16TargetLowering::isRomAddress(const SDValue &Op) {
// It is BUILD_PAIR((PIC16Lo TGA), (PIC16Hi TGA)) and Op is BUILD_PAIR
SDValue TGA = Op.getOperand(0).getOperand(0);
GlobalAddressSDNode *GSDN = dyn_cast<GlobalAddressSDNode>(TGA);
const Type *ValueType = GSDN->getGlobal()->getType();
int AddrSpace = GSDN->getGlobal()->getType()->getAddressSpace();
if (!isa<PointerType>(ValueType)) {
assert(0 && "TGA must be of a PointerType");
}
int AddrSpace = dyn_cast<PointerType>(ValueType)->getAddressSpace();
if (AddrSpace == PIC16ISD::ROM_SPACE)
return true;