[PATCH] D75198: [ms] Rename ParsingInlineAsm functions/variables to reflect MS-specificity.

2020-02-26 Thread Eric Astor via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG85b641c27aec: [ms] Rename ParsingInlineAsm 
functions/variables to reflect MS-specificity. (authored by epastor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75198/new/

https://reviews.llvm.org/D75198

Files:
  clang/lib/Parse/ParseStmtAsm.cpp
  llvm/include/llvm/MC/MCParser/MCAsmParser.h
  llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/MC/MCParser/MasmParser.cpp
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -611,9 +611,9 @@
 }
 bool onIdentifierExpr(const MCExpr *SymRef, StringRef SymRefName,
   const InlineAsmIdentifierInfo ,
-  bool ParsingInlineAsm, StringRef ) {
+  bool ParsingMSInlineAsm, StringRef ) {
   // InlineAsm: Treat an enum value as an integer
-  if (ParsingInlineAsm)
+  if (ParsingMSInlineAsm)
 if (IDInfo.isKind(InlineAsmIdentifierInfo::IK_EnumVal))
   return onInteger(IDInfo.Enum.EnumVal, ErrMsg);
   // Treat a symbolic constant like an integer
@@ -634,7 +634,7 @@
 MemExpr = true;
 State = IES_INTEGER;
 IC.pushOperand(IC_IMM);
-if (ParsingInlineAsm)
+if (ParsingMSInlineAsm)
   Info = IDInfo;
 break;
   }
@@ -815,7 +815,7 @@
   }
 }
 bool onOffset(const MCExpr *Val, SMLoc OffsetLoc, StringRef ID,
-  const InlineAsmIdentifierInfo , bool ParsingInlineAsm,
+  const InlineAsmIdentifierInfo , bool ParsingMSInlineAsm,
   StringRef ) {
   PrevState = State;
   switch (State) {
@@ -833,7 +833,7 @@
 // As we cannot yet resolve the actual value (offset), we retain
 // the requested semantics by pushing a '0' to the operands stack
 IC.pushOperand(IC_IMM);
-if (ParsingInlineAsm) {
+if (ParsingMSInlineAsm) {
   Info = IDInfo;
 }
 break;
@@ -899,10 +899,10 @@
 
   bool ParseIntelMemoryOperandSize(unsigned );
   std::unique_ptr
-  CreateMemForInlineAsm(unsigned SegReg, const MCExpr *Disp, unsigned BaseReg,
-unsigned IndexReg, unsigned Scale, SMLoc Start,
-SMLoc End, unsigned Size, StringRef Identifier,
-const InlineAsmIdentifierInfo );
+  CreateMemForMSInlineAsm(unsigned SegReg, const MCExpr *Disp, unsigned BaseReg,
+  unsigned IndexReg, unsigned Scale, SMLoc Start,
+  SMLoc End, unsigned Size, StringRef Identifier,
+  const InlineAsmIdentifierInfo );
 
   bool parseDirectiveEven(SMLoc L);
   bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
@@ -1177,7 +1177,7 @@
 
   // The "flags" and "mxcsr" registers cannot be referenced directly.
   // Treat it as an identifier instead.
-  if (isParsingInlineAsm() && isParsingIntelSyntax() &&
+  if (isParsingMSInlineAsm() && isParsingIntelSyntax() &&
   (RegNo == X86::EFLAGS || RegNo == X86::MXCSR))
 RegNo = 0;
 
@@ -1458,7 +1458,7 @@
   return ParseATTOperand();
 }
 
-std::unique_ptr X86AsmParser::CreateMemForInlineAsm(
+std::unique_ptr X86AsmParser::CreateMemForMSInlineAsm(
 unsigned SegReg, const MCExpr *Disp, unsigned BaseReg, unsigned IndexReg,
 unsigned Scale, SMLoc Start, SMLoc End, unsigned Size, StringRef Identifier,
 const InlineAsmIdentifierInfo ) {
@@ -1536,7 +1536,7 @@
   return true;
 StringRef ErrMsg;
 ParseError =
-SM.onOffset(Val, OffsetLoc, ID, Info, isParsingInlineAsm(), ErrMsg);
+SM.onOffset(Val, OffsetLoc, ID, Info, isParsingMSInlineAsm(), ErrMsg);
 if (ParseError)
   return Error(SMLoc::getFromPointer(Name.data()), ErrMsg);
   } else {
@@ -1595,7 +1595,7 @@
   // Symbol reference, when parsing assembly content
   InlineAsmIdentifierInfo Info;
   const MCExpr *Val;
-  if (!isParsingInlineAsm()) {
+  if (!isParsingMSInlineAsm()) {
 if (getParser().parsePrimaryExpr(Val, End)) {
   return Error(Tok.getLoc(), "Unexpected identifier!");
 } else if (SM.onIdentifierExpr(Val, Identifier, Info, false, ErrMsg)) {
@@ -1646,8 +1646,8 @@
 return Error(Loc, "invalid reference to undefined symbol");
   StringRef Identifier = Sym->getName();
   InlineAsmIdentifierInfo Info;
-  if (SM.onIdentifierExpr(Val, Identifier, Info,
-  isParsingInlineAsm(), ErrMsg))
+  if (SM.onIdentifierExpr(Val, Identifier, Info, isParsingMSInlineAsm(),
+  ErrMsg))
 return Error(Loc, ErrMsg);
   End = consumeToken();
   

[PATCH] D75198: [ms] Rename ParsingInlineAsm functions/variables to reflect MS-specificity.

2020-02-26 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75198/new/

https://reviews.llvm.org/D75198



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75198: [ms] Rename ParsingInlineAsm functions/variables to reflect MS-specificity.

2020-02-26 Thread Eric Astor via Phabricator via cfe-commits
epastor created this revision.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
epastor added a child revision: D73227: [ms] [llvm-ml] Use default RIP-relative 
addressing for x64 MASM..

ParsingInlineAsm was a misleading name. These values are only set for MS-style 
inline assembly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75198

Files:
  clang/lib/Parse/ParseStmtAsm.cpp
  llvm/include/llvm/MC/MCParser/MCAsmParser.h
  llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/MC/MCParser/MasmParser.cpp
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -611,9 +611,9 @@
 }
 bool onIdentifierExpr(const MCExpr *SymRef, StringRef SymRefName,
   const InlineAsmIdentifierInfo ,
-  bool ParsingInlineAsm, StringRef ) {
+  bool ParsingMSInlineAsm, StringRef ) {
   // InlineAsm: Treat an enum value as an integer
-  if (ParsingInlineAsm)
+  if (ParsingMSInlineAsm)
 if (IDInfo.isKind(InlineAsmIdentifierInfo::IK_EnumVal))
   return onInteger(IDInfo.Enum.EnumVal, ErrMsg);
   // Treat a symbolic constant like an integer
@@ -634,7 +634,7 @@
 MemExpr = true;
 State = IES_INTEGER;
 IC.pushOperand(IC_IMM);
-if (ParsingInlineAsm)
+if (ParsingMSInlineAsm)
   Info = IDInfo;
 break;
   }
@@ -815,7 +815,7 @@
   }
 }
 bool onOffset(const MCExpr *Val, SMLoc OffsetLoc, StringRef ID,
-  const InlineAsmIdentifierInfo , bool ParsingInlineAsm,
+  const InlineAsmIdentifierInfo , bool ParsingMSInlineAsm,
   StringRef ) {
   PrevState = State;
   switch (State) {
@@ -833,7 +833,7 @@
 // As we cannot yet resolve the actual value (offset), we retain
 // the requested semantics by pushing a '0' to the operands stack
 IC.pushOperand(IC_IMM);
-if (ParsingInlineAsm) {
+if (ParsingMSInlineAsm) {
   Info = IDInfo;
 }
 break;
@@ -899,10 +899,10 @@
 
   bool ParseIntelMemoryOperandSize(unsigned );
   std::unique_ptr
-  CreateMemForInlineAsm(unsigned SegReg, const MCExpr *Disp, unsigned BaseReg,
-unsigned IndexReg, unsigned Scale, SMLoc Start,
-SMLoc End, unsigned Size, StringRef Identifier,
-const InlineAsmIdentifierInfo );
+  CreateMemForMSInlineAsm(unsigned SegReg, const MCExpr *Disp, unsigned BaseReg,
+  unsigned IndexReg, unsigned Scale, SMLoc Start,
+  SMLoc End, unsigned Size, StringRef Identifier,
+  const InlineAsmIdentifierInfo );
 
   bool parseDirectiveEven(SMLoc L);
   bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
@@ -1177,7 +1177,7 @@
 
   // The "flags" and "mxcsr" registers cannot be referenced directly.
   // Treat it as an identifier instead.
-  if (isParsingInlineAsm() && isParsingIntelSyntax() &&
+  if (isParsingMSInlineAsm() && isParsingIntelSyntax() &&
   (RegNo == X86::EFLAGS || RegNo == X86::MXCSR))
 RegNo = 0;
 
@@ -1458,7 +1458,7 @@
   return ParseATTOperand();
 }
 
-std::unique_ptr X86AsmParser::CreateMemForInlineAsm(
+std::unique_ptr X86AsmParser::CreateMemForMSInlineAsm(
 unsigned SegReg, const MCExpr *Disp, unsigned BaseReg, unsigned IndexReg,
 unsigned Scale, SMLoc Start, SMLoc End, unsigned Size, StringRef Identifier,
 const InlineAsmIdentifierInfo ) {
@@ -1536,7 +1536,7 @@
   return true;
 StringRef ErrMsg;
 ParseError =
-SM.onOffset(Val, OffsetLoc, ID, Info, isParsingInlineAsm(), ErrMsg);
+SM.onOffset(Val, OffsetLoc, ID, Info, isParsingMSInlineAsm(), ErrMsg);
 if (ParseError)
   return Error(SMLoc::getFromPointer(Name.data()), ErrMsg);
   } else {
@@ -1595,7 +1595,7 @@
   // Symbol reference, when parsing assembly content
   InlineAsmIdentifierInfo Info;
   const MCExpr *Val;
-  if (!isParsingInlineAsm()) {
+  if (!isParsingMSInlineAsm()) {
 if (getParser().parsePrimaryExpr(Val, End)) {
   return Error(Tok.getLoc(), "Unexpected identifier!");
 } else if (SM.onIdentifierExpr(Val, Identifier, Info, false, ErrMsg)) {
@@ -1646,8 +1646,8 @@
 return Error(Loc, "invalid reference to undefined symbol");
   StringRef Identifier = Sym->getName();
   InlineAsmIdentifierInfo Info;
-  if (SM.onIdentifierExpr(Val, Identifier, Info,
-  isParsingInlineAsm(), ErrMsg))
+  if (SM.onIdentifierExpr(Val, Identifier, Info, isParsingMSInlineAsm(),
+  ErrMsg))