aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-01-27 20:38:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-01-27 20:38:24 +0000
commit03eb543cf7ebee463b33b5802b83ac92c21770cf (patch)
treebd511c9b73b843b5170087e7c9aa9e890457bd98 /lib/CodeGen/CGStmt.cpp
parent98abf4bd3526a00a0e5cf71a9462c181f97b1c81 (diff)
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 4adff72470..939ebec01e 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -932,7 +932,9 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
std::string InOutConstraints;
std::vector<llvm::Value*> InOutArgs;
std::vector<const llvm::Type*> InOutArgTypes;
-
+
+ llvm::SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
+
for (unsigned i = 0, e = S.getNumOutputs(); i != e; i++) {
std::string OutputConstraint(S.getOutputConstraint(i)->getStrData(),
S.getOutputConstraint(i)->getByteLength());
@@ -942,6 +944,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
Info);
assert(result && "Failed to parse output constraint"); result=result;
+ OutputConstraintInfos.push_back(Info);
+
// Simplify the output constraint.
OutputConstraint = SimplifyConstraint(OutputConstraint.c_str() + 1, Target);
@@ -993,6 +997,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
bool result = Target.validateInputConstraint(InputConstraint.c_str(),
S.begin_output_names(),
S.end_output_names(),
+ &OutputConstraintInfos[0],
Info); result=result;
assert(result && "Failed to parse input constraint");