Page MenuHomePhabricator

[NativePDB] Make GetTranslationUnitDecl return an lldb CompilerDeclCtx

Authored by lanza on Jul 12 2019, 8:21 PM.



We intend to make PdbAstBuilder abstract and implement
PdbAstBuilderClang along with any other languages that wish to use
PDBs. This is the first step.

Event Timeline

lanza created this revision.Jul 12 2019, 8:21 PM

I know Zach isn't working on lldb anymore. Not sure who else to tag for NativePDB stuff. There is going to be a ton of commits similar to this to follow.

aleksandr.urakov added a reviewer: amccarth.
aleksandr.urakov added a subscriber: amccarth.

LGTM, thanks! Sorry for the long delay with the reply, I had days off.

You can add @amccarth to reviewers of NativePDB patches, he has taken over the work for Zachary.

This revision is now accepted and ready to land.Jul 15 2019, 11:56 PM
amccarth added inline comments.Jul 16 2019, 10:57 AM

auto x = ...; return x; doesn't add any value. I'd just return the expression.


Should the return value become Expected<clang::DeclContext>?


The two statements above get repeated several times in this patch. Consider making a helper function like GetTranslationUnitDeclContext.

lanza updated this revision to Diff 210246.Jul 16 2019, 11:47 PM
lanza marked 2 inline comments as done.


lanza marked an inline comment as done.Jul 16 2019, 11:49 PM
lanza added inline comments.

Technically, yes. But not because of this code. Cleaning up some of the pointers is on my list of to-dos for this file as well.

lanza closed this revision.Jul 17 2019, 12:07 AM
amccarth marked an inline comment as done.Jul 17 2019, 7:59 AM



OK. I brought it up because the goal seems to be to take a step toward making these APIs more general and thus abstractable, and tweaking the return value would seem (to me) to be part of that. If you're planning to make those kinds in a future patch, then I'm satisfied.