summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit3674ebaa6b1c5039d43d55e559911dea115d30cc (patch)
treec272cfb3ebe1b25d2634dfe65d3d6d44e6a7b288 /clang/lib
parent8cecfe9fc964b33c2b895562be5ed0064730b23b (diff)
downloadbcm5719-llvm-3674ebaa6b1c5039d43d55e559911dea115d30cc.tar.gz
bcm5719-llvm-3674ebaa6b1c5039d43d55e559911dea115d30cc.zip
[ms-inline asm] Use asserts as these calls are now guarded by identical checks.
llvm-svn: 161676
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 6704858f8df..56ac7c5d46d 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud