diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-24 17:05:45 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-24 17:05:45 +0000 |
commit | be3ace834ee7438915e73d2115365d57d03ceb99 (patch) | |
tree | 343e85ece98e1c8bdfde01a057c14d56bb386d93 /lib/CodeGen | |
parent | 1016bdf939fd4a7b65793904610a7e647ec9d89f (diff) |
[ms-inline asm] Refactor code. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index c07fbf0454..ed27442cd8 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -1395,23 +1395,8 @@ static llvm::MDNode *getAsmSrcLocInfo(const StringLiteral *Str, } void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { - // Analyze the asm string to decompose it into its pieces. We know that Sema - // has already done this, so it is guaranteed to be successful. - SmallVector<AsmStmt::AsmStringPiece, 4> Pieces; - unsigned DiagOffs; - S.AnalyzeAsmString(Pieces, getContext(), DiagOffs); - - // Assemble the pieces into the final asm string. - std::string AsmString; - for (unsigned i = 0, e = Pieces.size(); i != e; ++i) { - if (Pieces[i].isString()) - AsmString += Pieces[i].getString(); - else if (Pieces[i].getModifier() == '\0') - AsmString += '$' + llvm::utostr(Pieces[i].getOperandNo()); - else - AsmString += "${" + llvm::utostr(Pieces[i].getOperandNo()) + ':' + - Pieces[i].getModifier() + '}'; - } + // Assemble the final asm string. + std::string AsmString = S.GenerateAsmString(getContext()); // Get all the output and input constraints together. SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos; |