[ms-inline asm] Simplify logic. No functional change intended.

llvm-svn: 162385
This commit is contained in:
Chad Rosier 2012-08-22 19:50:28 +00:00
parent a056d62961
commit a766697f4e
1 changed files with 11 additions and 5 deletions

View File

@ -360,7 +360,14 @@ static bool isSimpleMSAsm(std::vector<StringRef> &Pieces,
for (unsigned i = 1, e = Pieces.size(); i != e; ++i)
if (!TI.isValidGCCRegisterName(Pieces[i]))
return false;
return true;
}
static bool isSimpleMSAsm(std::vector<std::vector<StringRef> > Pieces,
const TargetInfo &TI) {
for (unsigned i = 0, e = Pieces.size(); i != e; ++i)
if (!isSimpleMSAsm(Pieces[i], TI))
return false;
return true;
}
@ -447,12 +454,11 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc,
std::vector<std::vector<StringRef> > Pieces;
Pieces.resize(NumAsmStrings);
bool IsSimple = true;
for (unsigned i = 0; i != NumAsmStrings; ++i) {
for (unsigned i = 0; i != NumAsmStrings; ++i)
buildMSAsmPieces(AsmStrings[i], Pieces[i]);
if (IsSimple)
IsSimple = isSimpleMSAsm(Pieces[i], Context.getTargetInfo());
}
bool IsSimple = isSimpleMSAsm(Pieces, Context.getTargetInfo());
// AsmParser doesn't fully support these asm statements.
if (bailOnMSAsm(Pieces)) { DEF_SIMPLE_MSASM; return Owned(NS); }