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 | 14836bab367fb1c47bb92c8585265dff971ebaf5 (patch) | |
tree | 328334b80643386cb89a020679410cd00259b1d1 /clang/lib/CodeGen | |
parent | cc27317a622f9fa1b415a93346b55d5d71acc29c (diff) | |
download | bcm5719-llvm-14836bab367fb1c47bb92c8585265dff971ebaf5.tar.gz bcm5719-llvm-14836bab367fb1c47bb92c8585265dff971ebaf5.zip |
[ms-inline asm] Refactor code. No functional change intended.
llvm-svn: 162568
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index c07fbf0454e..ed27442cd8f 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/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; |