diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-13 17:38:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-13 17:38:01 +0000 |
commit | 810f6d5d6223adaab0ccf0139f40de6484ad1bb5 (patch) | |
tree | 8c2283a32d43ceaaabee09ca1e692e300b905690 /lib/CodeGen/CGStmt.cpp | |
parent | ecdd84147c0765caa999ddc22dde25b42712bb4d (diff) |
introduce a new -fheinous-gnu-extensions flag that enables really
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a
warning when enabled).
As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index fddc547fd3..91aa88569e 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -730,6 +730,7 @@ llvm::Value* CodeGenFunction::EmitAsmInput(const AsmStmt &S, if (Ty->isSingleValueType()) { Arg = EmitScalarExpr(InputExpr); } else { + InputExpr = InputExpr->IgnoreParenNoopCasts(getContext()); LValue Dest = EmitLValue(InputExpr); uint64_t Size = CGM.getTargetData().getTypeSizeInBits(Ty); @@ -744,6 +745,7 @@ llvm::Value* CodeGenFunction::EmitAsmInput(const AsmStmt &S, } } } else { + InputExpr = InputExpr->IgnoreParenNoopCasts(getContext()); LValue Dest = EmitLValue(InputExpr); Arg = Dest.getAddress(); ConstraintStr += '*'; @@ -799,7 +801,10 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { // Simplify the output constraint. OutputConstraint = SimplifyConstraint(OutputConstraint.c_str() + 1, Target); - LValue Dest = EmitLValue(S.getOutputExpr(i)); + const Expr *OutExpr = S.getOutputExpr(i); + OutExpr = OutExpr->IgnoreParenNoopCasts(getContext()); + + LValue Dest = EmitLValue(OutExpr); const llvm::Type *DestValueType = cast<llvm::PointerType>(Dest.getAddress()->getType())->getElementType(); |