This is an archive of the discontinued LLVM Phabricator instance.

Add an SDK attribute to DICompileUnit
ClosedPublic

Authored by aprantl on Mar 4 2020, 2:12 PM.

Details

Summary

This is part of PR44213 https://bugs.llvm.org/show_bug.cgi?id=44213

When importing (system) Clang modules, LLDB needs to know which SDK (e.g., MacOSX, iPhoneSimulator, ...) they came from. While the sysroot attribute contains the absolute path to the SDK, this doesn't work well when the debugger is run on a different machine than the compiler, and the SDKs are installed in different directories. It thus makes sense to just store the name of the SDK instead of the absolute path, so it can be found relative to LLDB.

Diff Detail

Event Timeline

aprantl created this revision.Mar 4 2020, 2:12 PM
Herald added a project: Restricted Project. · View Herald Transcript

Mechanically seems fine (though probably/I think these sort of things should be committed in three parts - IR support, frontend usage, backend usage - but nice to review in one piece like this). I'll defer actual detailed review/sign-off to at least someone else with a vested interest in this features usage just to make sure it's got some in-review... review :)

davide accepted this revision.Mar 11 2020, 10:56 AM

Several minors. don't need another round trip before committing.

llvm/include/llvm-c/DebugInfo.h
255–256

Should we say Darwin or Apple platforms?

llvm/include/llvm/IR/DIBuilder.h
139–140

Ditto [and elsewhere if it's used, I'm not going to clutter the review repeating the same comment over and over]

llvm/lib/Bitcode/Reader/MetadataLoader.cpp
1475–1476

Unrelated, but ugh about this FIXME.

1477–1479

Not your fault but it would be great if. we could put a comment next to each line so we don't have to map back numbers to attributes.

This revision is now accepted and ready to land.Mar 11 2020, 10:56 AM
aprantl marked 3 inline comments as done.Mar 11 2020, 1:05 PM
aprantl added inline comments.
llvm/include/llvm-c/DebugInfo.h
255–256

I think Darwin is more precise here.

llvm/lib/Bitcode/Reader/MetadataLoader.cpp
1475–1476

Let's ping @dblaikie about that :-)

1477–1479

That's becoming a good idea!

This revision was automatically updated to reflect the committed changes.
dblaikie added inline comments.Mar 27 2020, 11:18 AM
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
1475–1476

Yeah, poked at the internal failure that I'm not currently able to reproduce & asked some folks - so after that, if no one's got better ideas I'll try resubmitting c51b45e32ef7f35c11891f60871aa9c2c04cd991