aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-10 18:20:12 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-10 18:20:12 +0000
commitf9a6a411e603370dd201ca1f5379fdf1ef3ecced (patch)
tree5a7ab5e44d5285733d7c5cdd689e9794293b3917 /lib/Sema/SemaStmt.cpp
parent2eb362b50f34296c39d5ec3e5e1bd6a2c9a5877e (diff)
[ms-inline asm] Use asserts as these calls are now guarded by identical checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 6704858f8d..56ac7c5d46 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -2798,16 +2798,14 @@ static std::string PatchMSAsmString(Sema &SemaRef, bool &IsSimple,
SourceLocation AsmLoc,
ArrayRef<Token> AsmToks,
const TargetInfo &TI) {
- // Assume simple asm stmt until we parse a non-register identifer.
- IsSimple = true;
-
- if (AsmToks.empty())
- return "";
-
+ assert (!AsmToks.empty() && "Didn't expect an empty AsmToks!");
std::string Res;
IdentifierInfo *II = AsmToks[0].getIdentifierInfo();
Res = II->getName().str();
+ // Assume simple asm stmt until we parse a non-register identifer.
+ IsSimple = true;
+
// Check the operands.
for (unsigned i = 1, e = AsmToks.size(); i != e; ++i) {
if (needSpaceAsmToken(AsmToks[i]))
@@ -2856,9 +2854,7 @@ static std::string PatchMSAsmString(Sema &SemaRef, bool &IsSimple,
static std::string buildMSAsmString(Sema &SemaRef,
ArrayRef<Token> AsmToks,
ArrayRef<unsigned> LineEnds) {
- if (AsmToks.empty())
- return "";
-
+ assert (!AsmToks.empty() && "Didn't expect an empty AsmToks!");
SmallString<512> Asm;
SmallString<512> TokenBuf;
TokenBuf.resize(512);