From: Matthias Braun Date: Mon, 5 Dec 2016 06:00:51 +0000 (+0000) Subject: Adapt to llvm/TableGen DagInit changes. X-Git-Tag: llvmorg-4.0.0-rc1~3019 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1b01996ef87eeaba13691c4698971ddc9693566;p=platform%2Fupstream%2Fllvm.git Adapt to llvm/TableGen DagInit changes. llvm-svn: 288645 --- diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp index 4318354..49c1edce 100644 --- a/clang/utils/TableGen/NeonEmitter.cpp +++ b/clang/utils/TableGen/NeonEmitter.cpp @@ -1478,14 +1478,14 @@ std::pair Intrinsic::DagEmitter::emitDagOp(DagInit *DI) { if (DI->getNumArgs() == 2) { // Unary op. std::pair R = - emitDagArg(DI->getArg(1), DI->getArgName(1)); + emitDagArg(DI->getArg(1), DI->getArgNameStr(1)); return std::make_pair(R.first, Op + R.second); } else { assert(DI->getNumArgs() == 3 && "Can only handle unary and binary ops!"); std::pair R1 = - emitDagArg(DI->getArg(1), DI->getArgName(1)); + emitDagArg(DI->getArg(1), DI->getArgNameStr(1)); std::pair R2 = - emitDagArg(DI->getArg(2), DI->getArgName(2)); + emitDagArg(DI->getArg(2), DI->getArgNameStr(2)); assert_with_loc(R1.first == R2.first, "Argument type mismatch!"); return std::make_pair(R1.first, R1.second + " " + Op + " " + R2.second); } @@ -1496,7 +1496,7 @@ std::pair Intrinsic::DagEmitter::emitDagCall(DagInit *DI) { std::vector Values; for (unsigned I = 0; I < DI->getNumArgs() - 1; ++I) { std::pair R = - emitDagArg(DI->getArg(I + 1), DI->getArgName(I + 1)); + emitDagArg(DI->getArg(I + 1), DI->getArgNameStr(I + 1)); Types.push_back(R.first); Values.push_back(R.second); } @@ -1529,7 +1529,8 @@ std::pair Intrinsic::DagEmitter::emitDagCast(DagInit *DI, bool IsBitCast){ // (cast MOD* VAL) -> cast VAL to type given by MOD. std::pair R = emitDagArg( - DI->getArg(DI->getNumArgs() - 1), DI->getArgName(DI->getNumArgs() - 1)); + DI->getArg(DI->getNumArgs() - 1), + DI->getArgNameStr(DI->getNumArgs() - 1)); Type castToType = R.first; for (unsigned ArgIdx = 0; ArgIdx < DI->getNumArgs() - 1; ++ArgIdx) { @@ -1540,11 +1541,11 @@ std::pair Intrinsic::DagEmitter::emitDagCast(DagInit *DI, // 4. The value "U" or "S" to switch the signedness. // 5. The value "H" or "D" to half or double the bitwidth. // 6. The value "8" to convert to 8-bit (signed) integer lanes. - if (!DI->getArgName(ArgIdx).empty()) { - assert_with_loc(Intr.Variables.find(DI->getArgName(ArgIdx)) != + if (!DI->getArgNameStr(ArgIdx).empty()) { + assert_with_loc(Intr.Variables.find(DI->getArgNameStr(ArgIdx)) != Intr.Variables.end(), "Variable not found"); - castToType = Intr.Variables[DI->getArgName(ArgIdx)].getType(); + castToType = Intr.Variables[DI->getArgNameStr(ArgIdx)].getType(); } else { StringInit *SI = dyn_cast(DI->getArg(ArgIdx)); assert_with_loc(SI, "Expected string type or $Name for cast type"); @@ -1659,9 +1660,9 @@ std::pair Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){ // (shuffle arg1, arg2, sequence) std::pair Arg1 = - emitDagArg(DI->getArg(0), DI->getArgName(0)); + emitDagArg(DI->getArg(0), DI->getArgNameStr(0)); std::pair Arg2 = - emitDagArg(DI->getArg(1), DI->getArgName(1)); + emitDagArg(DI->getArg(1), DI->getArgNameStr(1)); assert_with_loc(Arg1.first == Arg2.first, "Different types in arguments to shuffle!"); @@ -1703,7 +1704,8 @@ std::pair Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){ std::pair Intrinsic::DagEmitter::emitDagDup(DagInit *DI) { assert_with_loc(DI->getNumArgs() == 1, "dup() expects one argument"); - std::pair A = emitDagArg(DI->getArg(0), DI->getArgName(0)); + std::pair A = emitDagArg(DI->getArg(0), + DI->getArgNameStr(0)); assert_with_loc(A.first.isScalar(), "dup() expects a scalar argument"); Type T = Intr.getBaseType(); @@ -1721,8 +1723,10 @@ std::pair Intrinsic::DagEmitter::emitDagDup(DagInit *DI) { std::pair Intrinsic::DagEmitter::emitDagSplat(DagInit *DI) { assert_with_loc(DI->getNumArgs() == 2, "splat() expects two arguments"); - std::pair A = emitDagArg(DI->getArg(0), DI->getArgName(0)); - std::pair B = emitDagArg(DI->getArg(1), DI->getArgName(1)); + std::pair A = emitDagArg(DI->getArg(0), + DI->getArgNameStr(0)); + std::pair B = emitDagArg(DI->getArg(1), + DI->getArgNameStr(1)); assert_with_loc(B.first.isScalar(), "splat() requires a scalar int as the second argument"); @@ -1738,12 +1742,13 @@ std::pair Intrinsic::DagEmitter::emitDagSplat(DagInit *DI) { std::pair Intrinsic::DagEmitter::emitDagSaveTemp(DagInit *DI) { assert_with_loc(DI->getNumArgs() == 2, "save_temp() expects two arguments"); - std::pair A = emitDagArg(DI->getArg(1), DI->getArgName(1)); + std::pair A = emitDagArg(DI->getArg(1), + DI->getArgNameStr(1)); assert_with_loc(!A.first.isVoid(), "Argument to save_temp() must have non-void type!"); - std::string N = DI->getArgName(0); + std::string N = DI->getArgNameStr(0); assert_with_loc(!N.empty(), "save_temp() expects a name as the first argument");