Skip to content

Commit 786bf2e

Browse files
committed
[Clang][TableGen] MveEmitter
1 parent d4efc3e commit 786bf2e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

clang/utils/TableGen/MveEmitter.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,15 +1033,15 @@ class EmitterBase {
10331033
// to expand Tablegen classes like 'Vector' which mean something different in
10341034
// each member of a parametric family.
10351035
const Type *getType(const Record *R, const Type *Param);
1036-
const Type *getType(DagInit *D, const Type *Param);
1037-
const Type *getType(Init *I, const Type *Param);
1036+
const Type *getType(const DagInit *D, const Type *Param);
1037+
const Type *getType(const Init *I, const Type *Param);
10381038

10391039
// Functions that translate the Tablegen representation of an intrinsic's
10401040
// code generation into a collection of Value objects (which will then be
10411041
// reprocessed to read out the actual C++ code included by CGBuiltin.cpp).
1042-
Result::Ptr getCodeForDag(DagInit *D, const Result::Scope &Scope,
1042+
Result::Ptr getCodeForDag(const DagInit *D, const Result::Scope &Scope,
10431043
const Type *Param);
1044-
Result::Ptr getCodeForDagArg(DagInit *D, unsigned ArgNum,
1044+
Result::Ptr getCodeForDagArg(const DagInit *D, unsigned ArgNum,
10451045
const Result::Scope &Scope, const Type *Param);
10461046
Result::Ptr getCodeForArg(unsigned ArgNum, const Type *ArgType, bool Promote,
10471047
bool Immediate);
@@ -1060,7 +1060,7 @@ class EmitterBase {
10601060
void EmitBuiltinAliases(raw_ostream &OS);
10611061
};
10621062

1063-
const Type *EmitterBase::getType(Init *I, const Type *Param) {
1063+
const Type *EmitterBase::getType(const Init *I, const Type *Param) {
10641064
if (auto Dag = dyn_cast<DagInit>(I))
10651065
return getType(Dag, Param);
10661066
if (auto Def = dyn_cast<DefInit>(I))
@@ -1088,7 +1088,7 @@ const Type *EmitterBase::getType(const Record *R, const Type *Param) {
10881088
PrintFatalError(R->getLoc(), "Could not convert this record into a type");
10891089
}
10901090

1091-
const Type *EmitterBase::getType(DagInit *D, const Type *Param) {
1091+
const Type *EmitterBase::getType(const DagInit *D, const Type *Param) {
10921092
// The meat of the getType system: types in the Tablegen are represented by a
10931093
// dag whose operators select sub-cases of this function.
10941094

@@ -1156,7 +1156,8 @@ const Type *EmitterBase::getType(DagInit *D, const Type *Param) {
11561156
PrintFatalError("Bad operator in type dag expression");
11571157
}
11581158

1159-
Result::Ptr EmitterBase::getCodeForDag(DagInit *D, const Result::Scope &Scope,
1159+
Result::Ptr EmitterBase::getCodeForDag(const DagInit *D,
1160+
const Result::Scope &Scope,
11601161
const Type *Param) {
11611162
const Record *Op = cast<DefInit>(D->getOperator())->getDef();
11621163

@@ -1267,10 +1268,10 @@ Result::Ptr EmitterBase::getCodeForDag(DagInit *D, const Result::Scope &Scope,
12671268
}
12681269
}
12691270

1270-
Result::Ptr EmitterBase::getCodeForDagArg(DagInit *D, unsigned ArgNum,
1271+
Result::Ptr EmitterBase::getCodeForDagArg(const DagInit *D, unsigned ArgNum,
12711272
const Result::Scope &Scope,
12721273
const Type *Param) {
1273-
Init *Arg = D->getArg(ArgNum);
1274+
const Init *Arg = D->getArg(ArgNum);
12741275
StringRef Name = D->getArgNameStr(ArgNum);
12751276

12761277
if (!Name.empty()) {
@@ -1307,7 +1308,7 @@ Result::Ptr EmitterBase::getCodeForDagArg(DagInit *D, unsigned ArgNum,
13071308

13081309
PrintError("bad DAG argument type for code generation");
13091310
PrintNote("DAG: " + D->getAsString());
1310-
if (TypedInit *Typed = dyn_cast<TypedInit>(Arg))
1311+
if (const TypedInit *Typed = dyn_cast<TypedInit>(Arg))
13111312
PrintNote("argument type: " + Typed->getType()->getAsString());
13121313
PrintFatalNote("argument number " + Twine(ArgNum) + ": " + Arg->getAsString());
13131314
}
@@ -1379,10 +1380,10 @@ ACLEIntrinsic::ACLEIntrinsic(EmitterBase &ME, const Record *R,
13791380
HeaderOnly = R->getValueAsBit("headerOnly");
13801381

13811382
// Process the intrinsic's argument list.
1382-
DagInit *ArgsDag = R->getValueAsDag("args");
1383+
const DagInit *ArgsDag = R->getValueAsDag("args");
13831384
Result::Scope Scope;
13841385
for (unsigned i = 0, e = ArgsDag->getNumArgs(); i < e; ++i) {
1385-
Init *TypeInit = ArgsDag->getArg(i);
1386+
const Init *TypeInit = ArgsDag->getArg(i);
13861387

13871388
bool Promote = true;
13881389
if (auto TypeDI = dyn_cast<DefInit>(TypeInit))
@@ -1444,7 +1445,7 @@ ACLEIntrinsic::ACLEIntrinsic(EmitterBase &ME, const Record *R,
14441445

14451446
// Finally, go through the codegen dag and translate it into a Result object
14461447
// (with an arbitrary DAG of depended-on Results hanging off it).
1447-
DagInit *CodeDag = R->getValueAsDag("codegen");
1448+
const DagInit *CodeDag = R->getValueAsDag("codegen");
14481449
const Record *MainOp = cast<DefInit>(CodeDag->getOperator())->getDef();
14491450
if (MainOp->isSubClassOf("CustomCodegen")) {
14501451
// Or, if it's the special case of CustomCodegen, just accumulate

0 commit comments

Comments
 (0)