diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-22 19:50:28 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-22 19:50:28 +0000 |
commit | 153f8ecb5169347e41a0734ee1698498d88b96c5 (patch) | |
tree | 3f50379ca1af6294c23077a614ea1f22d69d9a15 | |
parent | e3f3825bd82f84f2a1ae0a02274a33298bb720b3 (diff) |
[ms-inline asm] Simplify logic. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162385 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaStmtAsm.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index a4a7a41277..732688d544 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -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); } |