[llvm] r233585 - IR: Use the new DebugLoc API, NFC
Pirama Arumuga Nainar
pirama at google.com
Wed May 6 10:54:29 PDT 2015
Hi Duncan, this commit seems to skip the update to lastDL in
BitcodeWriter.cpp:WriteFunction. Is that intentional?
> Message: 7
> Date: Mon, 30 Mar 2015 19:40:05 -0000
> From: "Duncan P. N. Exon Smith" <dexonsmith at apple.com>
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm] r233585 - IR: Use the new DebugLoc API, NFC
> Message-ID: <20150330194005.99A792A6C02F at llvm.org>
> Content-Type: text/plain; charset="utf-8"
> ...
> Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=233585&r1=233584&r2=233585&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
> +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Mar 30 14:40:05
> 2015
> @@ -2089,7 +2089,7 @@ static void WriteFunction(const Function
>
> bool NeedsMetadataAttachment = false;
>
> - DebugLoc LastDL;
> + MDLocation *LastDL = nullptr;
>
> // Finally, emit all the instructions, in order.
> for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E;
> ++BB)
> @@ -2104,10 +2104,9 @@ static void WriteFunction(const Function
> NeedsMetadataAttachment |= I->hasMetadataOtherThanDebugLoc();
>
> // If the instruction has a debug location, emit it.
> - DebugLoc DL = I->getDebugLoc();
> - if (DL.isUnknown()) {
> + MDLocation *DL = I->getDebugLoc();
> + if (!DL)
> continue;
> - }
>
> if (DL == LastDL) {
> // Just repeat the same debug loc as last time.
> @@ -2115,18 +2114,12 @@ static void WriteFunction(const Function
> continue;
> }
>
> - MDNode *Scope, *IA;
> - DL.getScopeAndInlinedAt(Scope, IA, I->getContext());
> - assert(Scope && "Expected valid scope");
> -
> - Vals.push_back(DL.getLine());
> - Vals.push_back(DL.getCol());
> - Vals.push_back(VE.getMetadataOrNullID(Scope));
> - Vals.push_back(VE.getMetadataOrNullID(IA));
> + Vals.push_back(DL->getLine());
> + Vals.push_back(DL->getColumn());
> + Vals.push_back(VE.getMetadataOrNullID(DL->getScope()));
> + Vals.push_back(VE.getMetadataOrNullID(DL->getInlinedAt()));
> Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC, Vals);
> Vals.clear();
> -
> - LastDL = DL;
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150506/c20fb0ff/attachment.html>
More information about the llvm-commits
mailing list