summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-22 19:50:28 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-22 19:50:28 +0000
commita766697f4e0f18c74c8cbd9f3813082cff08e18b (patch)
treedbbf71f5986ee4d5a3d43945547f5c9076ecf1e5 /clang/lib/Sema/SemaStmtAsm.cpp
parenta056d62961b96403b85e28255bbf8e7edfd0d88c (diff)
downloadbcm5719-llvm-a766697f4e0f18c74c8cbd9f3813082cff08e18b.tar.gz
bcm5719-llvm-a766697f4e0f18c74c8cbd9f3813082cff08e18b.zip
[ms-inline asm] Simplify logic. No functional change intended.
llvm-svn: 162385
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index a4a7a412776..732688d5446 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/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); }
OpenPOWER on IntegriCloud