From: David Blaikie Date: Fri, 2 Jan 2015 19:49:10 +0000 (+0000) Subject: DebugInfo: Remove some now-unnecessary location handling around function arguments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0f56b307e1125700cf269f3fda0dad9b36befb6;p=clang DebugInfo: Remove some now-unnecessary location handling around function arguments. r225000 generalized debug info line info handling for expressions such that this code is no longer necessary. This removes the last use of CGDebugInfo::getLocation, but not all the uses of CGDebugInfo::CurLoc, which is still used internally in CGDebugInfo. I'd like to do away with all of that & might succeed after a few more patches. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225085 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 6403fa99aa..f9b26b6210 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -2680,10 +2680,6 @@ 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()) { @@ -2704,8 +2700,6 @@ 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 @@ -2720,8 +2714,6 @@ 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/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index 92af27e4cc..4c73743b2c 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -222,9 +222,6 @@ 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.