summaryrefslogtreecommitdiff
path: root/utils/TableGen/IntrinsicEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/IntrinsicEmitter.cpp')
-rw-r--r--utils/TableGen/IntrinsicEmitter.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp
index 567973a3ca..ab7b58b8ba 100644
--- a/utils/TableGen/IntrinsicEmitter.cpp
+++ b/utils/TableGen/IntrinsicEmitter.cpp
@@ -114,9 +114,9 @@ EmitIntrinsicToNameTable(const std::vector<CodeGenIntrinsic> &Ints,
OS << "#endif\n\n";
}
-static void EmitTypeForValueType(std::ostream &OS, MVT::ValueType VT) {
- if (MVT::isInteger(VT)) {
- unsigned BitWidth = MVT::getSizeInBits(VT);
+static void EmitTypeForValueType(std::ostream &OS, MVT::SimpleValueType VT) {
+ if (MVT(VT).isInteger()) {
+ unsigned BitWidth = MVT(VT).getSizeInBits();
OS << "IntegerType::get(" << BitWidth << ")";
} else if (VT == MVT::Other) {
// MVT::OtherVT is used to mean the empty struct type here.
@@ -140,7 +140,7 @@ static void EmitTypeForValueType(std::ostream &OS, MVT::ValueType VT) {
static void EmitTypeGenerate(std::ostream &OS, Record *ArgType,
unsigned &ArgNo) {
- MVT::ValueType VT = getValueType(ArgType->getValueAsDef("VT"));
+ MVT::SimpleValueType VT = getValueType(ArgType->getValueAsDef("VT"));
if (ArgType->isSubClassOf("LLVMMatchType")) {
unsigned Number = ArgType->getValueAsInt("Number");
@@ -153,10 +153,11 @@ static void EmitTypeGenerate(std::ostream &OS, Record *ArgType,
// increment it when we actually hit an overloaded type. Getting this wrong
// leads to very subtle bugs!
OS << "Tys[" << ArgNo++ << "]";
- } else if (MVT::isVector(VT)) {
+ } else if (MVT(VT).isVector()) {
+ MVT VVT = VT;
OS << "VectorType::get(";
- EmitTypeForValueType(OS, MVT::getVectorElementType(VT));
- OS << ", " << MVT::getVectorNumElements(VT) << ")";
+ EmitTypeForValueType(OS, VVT.getVectorElementType().getSimpleVT());
+ OS << ", " << VVT.getVectorNumElements() << ")";
} else if (VT == MVT::iPTR) {
OS << "PointerType::getUnqual(";
EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy"), ArgNo);
@@ -225,7 +226,7 @@ void IntrinsicEmitter::EmitVerifier(const std::vector<CodeGenIntrinsic> &Ints,
assert(Number < j && "Invalid matching number!");
OS << "~" << Number;
} else {
- MVT::ValueType VT = getValueType(ArgType->getValueAsDef("VT"));
+ MVT::SimpleValueType VT = getValueType(ArgType->getValueAsDef("VT"));
OS << getEnumName(VT);
if (VT == MVT::isVoid && j != 0 && j != ArgTypes.size()-1)
throw "Var arg type not last argument";