IR: Introduce ConstantAggregate, NFC
Add a common parent class for ConstantArray, ConstantVector, and ConstantStruct called ConstantAggregate. These are the aggregate subclasses of Constant that take operands. This is mainly a cleanup, adding common `isa` target and removing duplicated code. However, it also simplifies caching which constants point transitively at `GlobalValue` (a possible future direction). llvm-svn: 265466
This commit is contained in:
@@ -1708,8 +1708,7 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
Record.push_back(
|
||||
CDS->getElementAsAPFloat(i).bitcastToAPInt().getLimitedValue());
|
||||
}
|
||||
} else if (isa<ConstantArray>(C) || isa<ConstantStruct>(C) ||
|
||||
isa<ConstantVector>(C)) {
|
||||
} else if (isa<ConstantAggregate>(C)) {
|
||||
Code = bitc::CST_CODE_AGGREGATE;
|
||||
for (const Value *Op : C->operands())
|
||||
Record.push_back(VE.getValueID(Op));
|
||||
|
||||
Reference in New Issue
Block a user