From 4e472d2277fcafb62c65539ac832a6ebd68c1a4d Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Sat, 20 Oct 2012 01:02:45 +0000 Subject: [PATCH] [ms-inline asm] Rename AsmOpRewrite to just AsmRewrite to be more generic. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166360 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCParser/AsmParser.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index c8fc4c02bc1..f22b2754f68 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -3575,7 +3575,7 @@ bool AsmParser::ParseDirectiveEndr(SMLoc DirectiveLoc) { } namespace { -enum AsmOpRewriteKind { +enum AsmRewriteKind { AOK_Imm, AOK_Input, AOK_Output, @@ -3583,13 +3583,13 @@ enum AsmOpRewriteKind { AOK_Skip }; -struct AsmOpRewrite { - AsmOpRewriteKind Kind; +struct AsmRewrite { + AsmRewriteKind Kind; SMLoc Loc; unsigned Len; unsigned Size; public: - AsmOpRewrite(AsmOpRewriteKind kind, SMLoc loc, unsigned len, unsigned size = 0) + AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len, unsigned size = 0) : Kind(kind), Loc(loc), Len(len), Size(size) { } }; } @@ -3608,7 +3608,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, SmallVector OutputConstraints; std::set ClobberRegs; - SmallVector AsmStrRewrites; + SmallVector AsmStrRewrites; // Prime the lexer. Lex(); @@ -3634,7 +3634,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, // emitting this directive. if (PreParseCondStateIgnore && TheCondState.Ignore) { unsigned Len = getLexer().getLoc().getPointer() - Start.getPointer(); - AsmStrRewrites.push_back(AsmOpRewrite(AOK_Skip, Start, Len)); + AsmStrRewrites.push_back(AsmRewrite(AOK_Skip, Start, Len)); continue; } @@ -3647,7 +3647,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, // Immediate. if (Operand->isImm()) { - AsmStrRewrites.push_back(AsmOpRewrite(AOK_Imm, + AsmStrRewrites.push_back(AsmRewrite(AOK_Imm, Operand->getStartLoc(), Operand->getNameLen())); continue; @@ -3673,7 +3673,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, if (OpDecl) { bool isOutput = (i == 1) && Desc.mayStore(); if (Operand->needSizeDirective()) - AsmStrRewrites.push_back(AsmOpRewrite(AOK_SizeDirective, + AsmStrRewrites.push_back(AsmRewrite(AOK_SizeDirective, Operand->getStartLoc(), 0, Operand->getMemSize())); @@ -3683,13 +3683,13 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, OutputDecls.push_back(OpDecl); Constraint += Operand->getConstraint().str(); OutputConstraints.push_back(Constraint); - AsmStrRewrites.push_back(AsmOpRewrite(AOK_Output, + AsmStrRewrites.push_back(AsmRewrite(AOK_Output, Operand->getStartLoc(), Operand->getNameLen())); } else { InputDecls.push_back(OpDecl); InputConstraints.push_back(Operand->getConstraint().str()); - AsmStrRewrites.push_back(AsmOpRewrite(AOK_Input, + AsmStrRewrites.push_back(AsmRewrite(AOK_Input, Operand->getStartLoc(), Operand->getNameLen())); } @@ -3728,14 +3728,14 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, // Build the IR assembly string. std::string AsmStringIR; - AsmOpRewriteKind PrevKind = AOK_Imm; + AsmRewriteKind PrevKind = AOK_Imm; raw_string_ostream OS(AsmStringIR); const char *Start = SrcMgr.getMemoryBuffer(0)->getBufferStart(); - for (SmallVectorImpl::iterator + for (SmallVectorImpl::iterator I = AsmStrRewrites.begin(), E = AsmStrRewrites.end(); I != E; ++I) { const char *Loc = (*I).Loc.getPointer(); - AsmOpRewriteKind Kind = (*I).Kind; + AsmRewriteKind Kind = (*I).Kind; // Emit everything up to the immediate/expression. If the previous rewrite // was a size directive, then this has already been done. -- 2.34.1