diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-21 22:09:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-21 22:09:29 +0000 |
commit | 935f0f01c1ed3c2052b797ac035d57a85b78adc4 (patch) | |
tree | b55ef3e832410363c4faa8fdba992a497c73b891 /lib/AST/Stmt.cpp | |
parent | f0c4d28020fb13fdbf7d6fccfab1b7b6a118ad0e (diff) |
add one more case of mismatched input/output constraints.
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output. This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:
Clang:
movb $-1, %al
frob %al
GCC:
movl $255, %eax
frob %al
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 7e73f02e67..8a80275aa1 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -218,6 +218,10 @@ unsigned AsmStmt::getNumPlusOperands() const { Expr *AsmStmt::getInputExpr(unsigned i) { return cast<Expr>(Exprs[i + NumOutputs]); } +void AsmStmt::setInputExpr(unsigned i, Expr *E) { + Exprs[i + NumOutputs] = E; +} + /// getInputConstraint - Return the specified input constraint. Unlike output /// constraints, these can be empty. |