This is an archive of the discontinued LLVM Phabricator instance.

Simplify arange output
ClosedPublic

Authored by rafael on Feb 2 2015, 7:45 AM.

Details

Reviewers
dblaikie
Summary

I was looking at emitDebugARanges and noticed it was the only user of SectionMap.

The attached patch changes it to compute SectionMap and saves a call to sort.

Diff Detail

Repository
rL LLVM

Event Timeline

rafael updated this revision to Diff 19154.Feb 2 2015, 7:45 AM
rafael retitled this revision from to Simplify arange output.
rafael updated this object.
rafael edited the test plan for this revision. (Show Details)
rafael added a reviewer: dblaikie.
rafael set the repository for this revision to rL LLVM.
dblaikie added inline comments.Feb 2 2015, 9:32 AM
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
1780

The code doesn't need to be split before/after this Sections construction, does it? Perhaps it could be kept/put together in a separate function and called - just with the Sections vector passed in?

1819

Is this code movement independent of the other code changes? It looks like it might just be general cleanup?

Or does the order of elements inserted into the Spans values matter/must be stable in the old code and doesn't need to be in the new code somehow?

The code doesn't need to be split before/after this Sections construction, does it? Perhaps it could be kept/put together in a separate function and called - just with the Sections vector passed in?

It does. The code before creates a SectionMap that is then used to
create Sections. The second part of the code uses Sections.

+ // If we have no section (e.g. common), just write out

+ // individual spans for each symbol.

Is this code movement independent of the other code changes? It looks like it might just be general cleanup?

It is. I committed that first and I will upload a rebased patch.

Cheers,
Rafael

rafael added a subscriber: Unknown Object (MLST).Feb 26 2015, 12:53 PM
rafael removed rL LLVM as the repository for this revision.

rebased

ping

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
1780

It needs to be split since the part above creates SectionMap, from which Sections is created.

dblaikie accepted this revision.Feb 26 2015, 1:38 PM
dblaikie edited edge metadata.

Looks good -thanks! sorry for the delay

(some optional/follow-up comments provided)

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
1758–1760

Refactoring might've been easier to understand if these two chunks had been pulled out into functions first, then the calls moved. (& might keep this function from getting quite so long/make it easier to read if there are some good names for these chunks of code (probably taken from the comment text))

1810

Don't really need this typedef, it's only used once.

This revision is now accepted and ready to land.Feb 26 2015, 1:38 PM
rafael closed this revision.Feb 26 2015, 2:05 PM

r230693.