summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-21 22:09:29 +0000
committerChris Lattner <sabre@nondot.org>2011-02-21 22:09:29 +0000
commit93ede02045c99d2163f1c63dbf323761a30388bf (patch)
treec3cfe8deeb96438a3def6bb4f9b38529ca5d234f /clang/lib/AST/Stmt.cpp
parent5e8603d1b9136ea9771b738376eaa44e36dc8d86 (diff)
downloadbcm5719-llvm-93ede02045c99d2163f1c63dbf323761a30388bf.tar.gz
bcm5719-llvm-93ede02045c99d2163f1c63dbf323761a30388bf.zip
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 llvm-svn: 126148
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r--clang/lib/AST/Stmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 7e73f02e67e..8a80275aa16 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud