mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-01 16:51:27 +00:00
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:
1 parent
f880d35b80
commit
1de3c7e790
9 files changed
+78
-86
No files matched your search
@@ -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