diff options
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 4492ea9a8f3..24082240b5a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -1411,11 +1411,12 @@ AddVariableConstraints(const std::string &Constraint, const Expr &AsmExpr, llvm::Value* CodeGenFunction::EmitAsmInputLValue(const TargetInfo::ConstraintInfo &Info, LValue InputValue, QualType InputType, - std::string &ConstraintStr) { + std::string &ConstraintStr, + SourceLocation Loc) { llvm::Value *Arg; if (Info.allowsRegister() || !Info.allowsMemory()) { if (CodeGenFunction::hasScalarEvaluationKind(InputType)) { - Arg = EmitLoadOfLValue(InputValue).getScalarVal(); + Arg = EmitLoadOfLValue(InputValue, Loc).getScalarVal(); } else { llvm::Type *Ty = ConvertType(InputType); uint64_t Size = CGM.getDataLayout().getTypeSizeInBits(Ty); @@ -1448,7 +1449,8 @@ llvm::Value* CodeGenFunction::EmitAsmInput( InputExpr = InputExpr->IgnoreParenNoopCasts(getContext()); LValue Dest = EmitLValue(InputExpr); - return EmitAsmInputLValue(Info, Dest, InputExpr->getType(), ConstraintStr); + return EmitAsmInputLValue(Info, Dest, InputExpr->getType(), ConstraintStr, + InputExpr->getExprLoc()); } /// getAsmSrcLocInfo - Return the !srcloc metadata node to attach to an inline @@ -1593,7 +1595,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { const Expr *InputExpr = S.getOutputExpr(i); llvm::Value *Arg = EmitAsmInputLValue(Info, Dest, InputExpr->getType(), - InOutConstraints); + InOutConstraints, + InputExpr->getExprLoc()); if (llvm::Type* AdjTy = getTargetHooks().adjustInlineAsmType(*this, OutputConstraint, @@ -1804,7 +1807,7 @@ CodeGenFunction::EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K) { // Emit the CapturedDecl CodeGenFunction CGF(CGM, true); CGF.CapturedStmtInfo = new CGCapturedStmtInfo(S, K); - llvm::Function *F = CGF.GenerateCapturedStmtFunction(CD, RD); + llvm::Function *F = CGF.GenerateCapturedStmtFunction(CD, RD, S.getLocStart()); delete CGF.CapturedStmtInfo; // Emit call to the helper function. @@ -1816,7 +1819,8 @@ CodeGenFunction::EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K) { /// Creates the outlined function for a CapturedStmt. llvm::Function * CodeGenFunction::GenerateCapturedStmtFunction(const CapturedDecl *CD, - const RecordDecl *RD) { + const RecordDecl *RD, + SourceLocation Loc) { assert(CapturedStmtInfo && "CapturedStmtInfo should be set when generating the captured function"); @@ -1851,8 +1855,7 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedDecl *CD, LValue LV = MakeNaturalAlignAddrLValue(CapturedStmtInfo->getContextValue(), Ctx.getTagDeclType(RD)); LValue ThisLValue = EmitLValueForField(LV, FD); - - CXXThisValue = EmitLoadOfLValue(ThisLValue).getScalarVal(); + CXXThisValue = EmitLoadOfLValue(ThisLValue, Loc).getScalarVal(); } CapturedStmtInfo->EmitBody(*this, CD->getBody()); |