summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/utils/TableGen/AsmWriterInst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/utils/TableGen/AsmWriterInst.cpp')
-rw-r--r--gnu/llvm/utils/TableGen/AsmWriterInst.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/gnu/llvm/utils/TableGen/AsmWriterInst.cpp b/gnu/llvm/utils/TableGen/AsmWriterInst.cpp
index 5b09765a275..2c19e5d663d 100644
--- a/gnu/llvm/utils/TableGen/AsmWriterInst.cpp
+++ b/gnu/llvm/utils/TableGen/AsmWriterInst.cpp
@@ -26,7 +26,7 @@ static bool isIdentChar(char C) {
C == '_';
}
-std::string AsmWriterOperand::getCode() const {
+std::string AsmWriterOperand::getCode(bool PassSubtarget) const {
if (OperandType == isLiteralTextOperand) {
if (Str.size() == 1)
return "O << '" + Str + "';";
@@ -50,9 +50,9 @@ std::string AsmWriterOperand::getCode() const {
/// ParseAsmString - Parse the specified Instruction's AsmString into this
/// AsmWriterInst.
///
-AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant,
- unsigned PassSubtarget) {
- this->CGI = &CGI;
+AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned CGIIndex,
+ unsigned Variant)
+ : CGI(&CGI), CGIIndex(CGIIndex) {
// NOTE: Any extensions to this code need to be mirrored in the
// AsmPrinter::printInlineAsm code that executes as compile time (assuming
@@ -120,8 +120,7 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant,
while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
++VarEnd;
- std::string VarName(AsmString.begin()+DollarPos+1,
- AsmString.begin()+VarEnd);
+ StringRef VarName(AsmString.data()+DollarPos+1, VarEnd-DollarPos-1);
// Modifier - Support ${foo:modifier} syntax, where "modifier" is passed
// into printOperand. Also support ${:feature}, which is passed into
@@ -143,7 +142,7 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant,
PrintFatalError("Reached end of string before terminating curly brace in '"
+ CGI.TheDef->getName() + "'");
- unsigned ModifierStart = VarEnd;
+ std::string::size_type ModifierStart = VarEnd;
while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
++VarEnd;
Modifier = std::string(AsmString.begin()+ModifierStart,
@@ -163,16 +162,14 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant,
if (VarName.empty()) {
// Just a modifier, pass this into PrintSpecial.
- Operands.emplace_back("PrintSpecial", ~0U, ~0U, Modifier,
- PassSubtarget);
+ Operands.emplace_back("PrintSpecial", ~0U, Modifier);
} else {
// Otherwise, normal operand.
unsigned OpNo = CGI.Operands.getOperandNamed(VarName);
CGIOperandList::OperandInfo OpInfo = CGI.Operands[OpNo];
unsigned MIOp = OpInfo.MIOperandNo;
- Operands.emplace_back(OpInfo.PrinterMethodName, OpNo, MIOp, Modifier,
- PassSubtarget);
+ Operands.emplace_back(OpInfo.PrinterMethodName, MIOp, Modifier);
}
LastEmitted = VarEnd;
}