summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/MC/MCParser/MCAsmParser.h2
-rw-r--r--llvm/include/llvm/MC/MCTargetAsmParser.h18
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp17
3 files changed, 17 insertions, 20 deletions
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
index ffe89e6fa1c..bfcb5cd6259 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
@@ -35,7 +35,6 @@ public:
void *OpDecl;
bool IsVarDecl;
unsigned Length, Size, Type;
- StringRef InternalName;
void clear() {
OpDecl = nullptr;
@@ -43,7 +42,6 @@ public:
Length = 1;
Size = 0;
Type = 0;
- InternalName = "";
}
};
diff --git a/llvm/include/llvm/MC/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCTargetAsmParser.h
index 80bf7dc4de0..cf9230758f2 100644
--- a/llvm/include/llvm/MC/MCTargetAsmParser.h
+++ b/llvm/include/llvm/MC/MCTargetAsmParser.h
@@ -44,16 +44,16 @@ enum AsmRewriteKind {
const char AsmRewritePrecedence [] = {
0, // AOK_Delete
- 1, // AOK_Align
- 1, // AOK_DotOperator
- 1, // AOK_Emit
- 3, // AOK_Imm
- 3, // AOK_ImmPrefix
- 2, // AOK_Input
- 2, // AOK_Output
- 4, // AOK_SizeDirective
+ 2, // AOK_Align
+ 2, // AOK_DotOperator
+ 2, // AOK_Emit
+ 4, // AOK_Imm
+ 4, // AOK_ImmPrefix
+ 3, // AOK_Input
+ 3, // AOK_Output
+ 5, // AOK_SizeDirective
1, // AOK_Label
- 1 // AOK_Skip
+ 2 // AOK_Skip
};
struct AsmRewrite {
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 8fec1c3a49d..519ada2b4b9 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1047,12 +1047,6 @@ std::unique_ptr<X86Operand> X86AsmParser::CreateMemForInlineAsm(
InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_SizeDirective, Start,
/*Len=*/0, Size));
}
- if (!Info.InternalName.empty()) {
- // Push a rewrite for replacing the identifier name with the internal name.
- InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_Label, Start,
- End.getPointer() - Start.getPointer(),
- Info.InternalName));
- }
}
// When parsing inline assembly we set the base register to a non-zero value
@@ -1347,9 +1341,14 @@ bool X86AsmParser::ParseIntelIdentifier(const MCExpr *&Val,
// If the identifier lookup was unsuccessful, assume that we are dealing with
// a label.
if (!Result) {
- Identifier = SemaCallback->LookupInlineAsmLabel(Identifier, getSourceManager(), Loc, false);
- assert(Identifier.size() && "We should have an internal name here.");
- Info.InternalName = Identifier;
+ StringRef InternalName =
+ SemaCallback->LookupInlineAsmLabel(Identifier, getSourceManager(),
+ Loc, false);
+ assert(InternalName.size() && "We should have an internal name here.");
+ // Push a rewrite for replacing the identifier name with the internal name.
+ InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_Label, Loc,
+ Identifier.size(),
+ InternalName));
}
// Create the symbol reference.
OpenPOWER on IntegriCloud