This is an archive of the discontinued LLVM Phabricator instance.

[Tooling] Add optional argument to getFullyQualifiedName to prepend "::".
ClosedPublic

Authored by sivachandra on Jun 23 2016, 3:58 PM.

Diff Detail

Event Timeline

sivachandra retitled this revision from to [Tooling] Add optional argument to getFullyQualifiedName to prepend "::"..
sivachandra updated this object.
sivachandra added reviewers: rnk, saugustine.
sivachandra added a subscriber: cfe-commits.
saugustine accepted this revision.Jun 24 2016, 11:04 AM
saugustine edited edge metadata.

This looks good and useful to me on the Tooling/Core side, but someone more familiar with the internals of NestedNamesSpecifiers should sign off on that portion.

Also, I would probably add a test case for _Bool, which is a case that has confused other logic like this. I think it will work, but may as well include the proof.

This revision is now accepted and ready to land.Jun 24 2016, 11:04 AM
rnk added inline comments.Jun 24 2016, 11:10 AM
lib/AST/NestedNameSpecifier.cpp
50

Doesn't this mutate the AST in place? We shouldn't be doing that.

lib/Tooling/Core/QualTypeNames.cpp
405

Rather than building the NNS here and mutating it after the fact, why not pass WithGlobalNsPrefix down to createNestedNameSpecifierForScopeOf?

sivachandra edited edge metadata.

A little adjustment.

sivachandra added inline comments.Jun 24 2016, 1:27 PM
lib/Tooling/Core/QualTypeNames.cpp
405

I think that can eliminate the need for the Prepend method. Let me dig a little more and get back.

Address comments.

PTAL

lib/Tooling/Core/QualTypeNames.cpp
405

WithGlobalNsPrefix has been added to every function in this file :)

This eliminates the need for the Prepend function.

Improve global type handling.

rnk accepted this revision.Jun 29 2016, 11:24 AM
rnk edited edge metadata.

lgtm

sivachandra closed this revision.Jun 29 2016, 3:45 PM

Thanks for the review; Committed.