This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add support for basic location translation to LLVM.
ClosedPublic

Authored by rriddle on Feb 3 2020, 3:15 PM.

Details

Summary

This revision adds basic support for emitting line table information when exporting to LLVMIR. We don't yet have a story for supporting all of the LLVM debug metadata, so this revision stubs some features(like subprograms) to enable emitting line tables.

Depends On D73932

Diff Detail

Event Timeline

rriddle created this revision.Feb 3 2020, 3:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2020, 3:15 PM

Unit tests: pass. 62434 tests passed, 0 failed and 845 were skipped.

clang-tidy: fail. clang-tidy found 1 errors and 0 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

ftynse accepted this revision.Feb 4 2020, 2:36 PM

Thanks River, this is very useful!

I'm not an expert on LLVM debuginfo though.

mlir/lib/Target/LLVMIR/DebugTranslation.cpp
29

I'd explicitly initialize compileUnit to nullptr since it is later used as a signaling state for not doing anything.

31

Nit: I was confused by the name of the operation into believing that it would interrupt in _absence_ of location info, but it's the inverse. The code is correct though.

34

Nit: please specify what exactly isn't correct (e.g., using C as language)

39

Nit: could we have parameter names in comments for "" and 0 as well?

This revision is now accepted and ready to land.Feb 4 2020, 2:36 PM
rriddle updated this revision to Diff 242477.Feb 4 2020, 5:27 PM
rriddle marked 4 inline comments as done.

Resolve comments

rriddle updated this revision to Diff 242478.Feb 4 2020, 5:28 PM

Add comma.

Unit tests: unknown.

clang-tidy: fail. clang-tidy found 1 errors and 0 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Unit tests: unknown.

clang-tidy: fail. clang-tidy found 1 errors and 0 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Cool stuff! :) This reminds me that we don't have proper debug information to and from SPIR-V binary format too. Need to add that some day too. ;-P

This revision was automatically updated to reflect the committed changes.