diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-23 21:55:11 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-23 21:55:11 +0000 |
commit | 2603fa6c0e0fff904317b525724170ba8ae5bfa8 (patch) | |
tree | e7da4bd2b0f60ea47c4048aa87129921d9dbbf17 | |
parent | 3fe198bf0d6118c7b080c17c3bb28d7c84e458b9 (diff) |
[ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
by CodeGen.
In the long-term, much of the codegen logic will be shared between the GNU-style
and MS-style inline assembly, but for now I'm replicating this logic to avoid
regressions with the GNU-style.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162478 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Stmt.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index da249e8bfd..ed2d78f507 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -1657,6 +1657,44 @@ public: std::string *getAsmString() { return &AsmStr; } void setAsmString(StringRef &E) { AsmStr = E.str(); } + //===--- Output operands ---===// + + unsigned getNumOutputs() const { return NumOutputs; } + + IdentifierInfo *getOutputIdentifier(unsigned i) const { + return Names[i]; + } + + StringRef getOutputName(unsigned i) const { + if (IdentifierInfo *II = getOutputIdentifier(i)) + return II->getName(); + + return StringRef(); + } + + const Expr *getOutputExpr(unsigned i) const { + return const_cast<MSAsmStmt*>(this)->getOutputExpr(i); + } + + //===--- Input operands ---===// + + unsigned getNumInputs() const { return NumInputs; } + + IdentifierInfo *getInputIdentifier(unsigned i) const { + return Names[i + NumOutputs]; + } + + StringRef getInputName(unsigned i) const { + if (IdentifierInfo *II = getInputIdentifier(i)) + return II->getName(); + + return StringRef(); + } + + const Expr *getInputExpr(unsigned i) const { + return const_cast<MSAsmStmt*>(this)->getInputExpr(i); + } + //===--- Other ---===// unsigned getNumClobbers() const { return NumClobbers; } |