aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);