diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-01-07 18:23:08 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-01-07 18:23:08 +0000 |
| commit | eac50037fb01dff75fda73c32ceebc7b34afd11d (patch) | |
| tree | d4c91c55d9ad00486117e40a1f504b0decfe2de5 /clang/lib/CodeGen | |
| parent | 4d77fdf3115d32c3f50b07fb6c1254daebd66086 (diff) | |
| download | bcm5719-llvm-eac50037fb01dff75fda73c32ceebc7b34afd11d.tar.gz bcm5719-llvm-eac50037fb01dff75fda73c32ceebc7b34afd11d.zip | |
Revert r225085, it caused PR22096.
PR22096 has several test cases that assert that look fairly different. I'm
adding one of those as an automated test, but when relanding the other cases
should probably be checked as well.
llvm-svn: 225361
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index f9b26b62103..6403fa99aa7 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2680,6 +2680,10 @@ void CodeGenFunction::EmitCallArgs(CallArgList &Args, const FunctionDecl *CalleeDecl, unsigned ParamsToSkip, bool ForceColumnInfo) { + CGDebugInfo *DI = getDebugInfo(); + SourceLocation CallLoc; + if (DI) CallLoc = DI->getLocation(); + // We *have* to evaluate arguments from right to left in the MS C++ ABI, // because arguments are destroyed left to right in the callee. if (CGM.getTarget().getCXXABI().areArgsDestroyedLeftToRightInCallee()) { @@ -2700,6 +2704,8 @@ void CodeGenFunction::EmitCallArgs(CallArgList &Args, EmitCallArg(Args, *Arg, ArgTypes[I]); emitNonNullArgCheck(*this, Args.back().RV, ArgTypes[I], Arg->getExprLoc(), CalleeDecl, ParamsToSkip + I); + // Restore the debug location. + if (DI) DI->EmitLocation(Builder, CallLoc, ForceColumnInfo); } // Un-reverse the arguments we just evaluated so they match up with the LLVM @@ -2714,6 +2720,8 @@ void CodeGenFunction::EmitCallArgs(CallArgList &Args, EmitCallArg(Args, *Arg, ArgTypes[I]); emitNonNullArgCheck(*this, Args.back().RV, ArgTypes[I], Arg->getExprLoc(), CalleeDecl, ParamsToSkip + I); + // Restore the debug location. + if (DI) DI->EmitLocation(Builder, CallLoc, ForceColumnInfo); } } diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 8422a1f8e37..0be032c1d79 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -222,6 +222,9 @@ public: /// invalid it is ignored. void setLocation(SourceLocation Loc); + /// getLocation - Return the current source location. + SourceLocation getLocation() const { return CurLoc; } + /// EmitLocation - Emit metadata to indicate a change in line/column /// information in the source file. /// \param ForceColumnInfo Assume DebugColumnInfo option is true. |

