mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Only compute intrinsic valuetypes when in a target .td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -34,7 +34,10 @@ namespace llvm {
|
|||||||
/// of the arguments. These are things like Type::UIntTyID.
|
/// of the arguments. These are things like Type::UIntTyID.
|
||||||
std::vector<std::string> ArgTypes;
|
std::vector<std::string> ArgTypes;
|
||||||
|
|
||||||
/// ArgVTs - The MVT::ValueType for each argument type.
|
/// ArgVTs - The MVT::ValueType for each argument type. Note that this list
|
||||||
|
/// is only populated when in the context of a target .td file. When
|
||||||
|
/// building Intrinsics.td, this isn't available, because we don't know the
|
||||||
|
/// target pointer size.
|
||||||
std::vector<MVT::ValueType> ArgVTs;
|
std::vector<MVT::ValueType> ArgVTs;
|
||||||
|
|
||||||
/// ArgTypeDefs - The records for each argument type.
|
/// ArgTypeDefs - The records for each argument type.
|
||||||
|
@ -362,8 +362,17 @@ std::vector<CodeGenIntrinsic> llvm::LoadIntrinsics(const RecordKeeper &RC) {
|
|||||||
std::vector<Record*> I = RC.getAllDerivedDefinitions("Intrinsic");
|
std::vector<Record*> I = RC.getAllDerivedDefinitions("Intrinsic");
|
||||||
|
|
||||||
std::vector<CodeGenIntrinsic> Result;
|
std::vector<CodeGenIntrinsic> Result;
|
||||||
|
|
||||||
|
// If we are in the context of a target .td file, get the target info so that
|
||||||
|
// we can decode the current intptr_t.
|
||||||
|
CodeGenTarget *CGT = 0;
|
||||||
|
if (Records.getClass("Target") &&
|
||||||
|
Records.getAllDerivedDefinitions("Target").size() == 1)
|
||||||
|
CGT = new CodeGenTarget();
|
||||||
|
|
||||||
for (unsigned i = 0, e = I.size(); i != e; ++i)
|
for (unsigned i = 0, e = I.size(); i != e; ++i)
|
||||||
Result.push_back(CodeGenIntrinsic(I[i], 0));
|
Result.push_back(CodeGenIntrinsic(I[i], CGT));
|
||||||
|
delete CGT;
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,7 +423,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R, CodeGenTarget *CGT) {
|
|||||||
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
assert(TyEl->isSubClassOf("LLVMType") && "Expected a type!");
|
||||||
ArgTypes.push_back(TyEl->getValueAsString("TypeVal"));
|
ArgTypes.push_back(TyEl->getValueAsString("TypeVal"));
|
||||||
|
|
||||||
ArgVTs.push_back(getValueType(TyEl->getValueAsDef("VT"), 0));
|
if (CGT)
|
||||||
|
ArgVTs.push_back(getValueType(TyEl->getValueAsDef("VT"), CGT));
|
||||||
ArgTypeDefs.push_back(TyEl);
|
ArgTypeDefs.push_back(TyEl);
|
||||||
}
|
}
|
||||||
if (ArgTypes.size() == 0)
|
if (ArgTypes.size() == 0)
|
||||||
|
Reference in New Issue
Block a user