GCBI: collect and expose ABI registers

This commit is contained in:
Alessandro Di Federico
2019-03-01 20:10:21 +01:00
parent 3a127dc7b3
commit b232678477
3 changed files with 11 additions and 1 deletions
@@ -40,6 +40,11 @@ bool GeneratedCodeBasicInfo::runOnModule(llvm::Module &M) {
DelaySlotSize = QMD.extract<uint32_t>(Tuple, 1);
PC = M.getGlobalVariable(QMD.extract<StringRef>(Tuple, 2), true);
SP = M.getGlobalVariable(QMD.extract<StringRef>(Tuple, 3), true);
auto Operands = QMD.extract<MDTuple *>(Tuple, 4)->operands();
for (const MDOperand &Operand : Operands) {
StringRef Name = QMD.extract<StringRef>(Operand.get());
ABIRegisters.push_back(M.getGlobalVariable(Name, true));
}
Type *PCType = PC->getType()->getPointerElementType();
PCRegSize = M.getDataLayout().getTypeAllocSize(PCType);