diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-28 00:24:05 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-28 00:24:05 +0000 |
commit | c4fb221120f2c8b158082d0b2b9daa29d2f65d5b (patch) | |
tree | cb1c469f08d5ac76f9ac0c6471481c5ce6d8ebfa /lib | |
parent | c178d76c027d4259c00d4b0b910ad4875c286298 (diff) |
[ms-inline asm] Hoist more common code into the AsmStmt base class. Add stubs
with FIXMEs for unimplemented features. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Stmt.cpp | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index fc66202c4a..b7c2b39895 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -321,6 +321,16 @@ bool Stmt::hasImplicitControlFlow() const { } } +/// getNumPlusOperands - Return the number of output operands that have a "+" +/// constraint. +unsigned AsmStmt::getNumPlusOperands() const { + unsigned Res = 0; + for (unsigned i = 0, e = getNumOutputs(); i != e; ++i) + if (isOutputPlusConstraint(i)) + ++Res; + return Res; +} + StringRef GCCAsmStmt::getClobber(unsigned i) const { return getClobberStringLiteral(i)->getString(); } @@ -336,16 +346,6 @@ StringRef GCCAsmStmt::getOutputConstraint(unsigned i) const { return getOutputConstraintLiteral(i)->getString(); } -/// getNumPlusOperands - Return the number of output operands that have a "+" -/// constraint. -unsigned GCCAsmStmt::getNumPlusOperands() const { - unsigned Res = 0; - for (unsigned i = 0, e = getNumOutputs(); i != e; ++i) - if (isOutputPlusConstraint(i)) - ++Res; - return Res; -} - Expr *GCCAsmStmt::getInputExpr(unsigned i) { return cast<Expr>(Exprs[i + NumOutputs]); } @@ -353,14 +353,12 @@ void GCCAsmStmt::setInputExpr(unsigned i, Expr *E) { Exprs[i + NumOutputs] = E; } - /// getInputConstraint - Return the specified input constraint. Unlike output /// constraints, these can be empty. StringRef GCCAsmStmt::getInputConstraint(unsigned i) const { return getInputConstraintLiteral(i)->getString(); } - void GCCAsmStmt::setOutputsAndInputsAndClobbers(ASTContext &C, IdentifierInfo **Names, StringLiteral **Constraints, @@ -584,6 +582,14 @@ Expr *MSAsmStmt::getOutputExpr(unsigned i) { return cast<Expr>(Exprs[i]); } +/// getOutputConstraint - Return the constraint string for the specified +/// output operand. All output constraints are known to be non-empty (either +/// '=' or '+'). +StringRef MSAsmStmt::getOutputConstraint(unsigned i) const { + // FIXME: Compute constraints. + return StringRef(); +} + Expr *MSAsmStmt::getInputExpr(unsigned i) { return cast<Expr>(Exprs[i + NumOutputs]); } @@ -591,6 +597,13 @@ void MSAsmStmt::setInputExpr(unsigned i, Expr *E) { Exprs[i + NumOutputs] = E; } +/// getInputConstraint - Return the specified input constraint. Unlike output +/// constraints, these can be empty. +StringRef MSAsmStmt::getInputConstraint(unsigned i) const { + // FIXME: Compute constraints. + return StringRef(); +} + QualType CXXCatchStmt::getCaughtType() const { if (ExceptionDecl) return ExceptionDecl->getType(); |