This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] import FunctionDecl end locations
ClosedPublic

Authored by r.stahl on Jul 4 2018, 8:14 AM.

Diff Detail

Event Timeline

r.stahl created this revision.Jul 4 2018, 8:14 AM

improved code quality; added nested macro test. it "works", but is disabled because it revealed another bug: the function end location is not imported. will send a patch

Related to this.

martong added inline comments.Jul 4 2018, 8:57 AM
lib/AST/ASTImporter.cpp
2558

Why don't we need to call the setRangeEnd() when e.g. we create a CXXMethodDecl or a CXXConversionDecl? Couldn't we just call this after all these branches (at line 2587)?

Hello Rafael.
This change is good, just some cleanup is needed.

lib/AST/ASTImporter.cpp
2558

I guess the reason is that they take LocEnd as ctor arguments. However, I think that having a single point is better.

r.stahl updated this revision to Diff 154215.Jul 5 2018, 6:03 AM
r.stahl marked 2 inline comments as done.

Alright, but then I would suggest to pass an invalid loc to the constructors instead to make it more explicit and save a map lookup in the import function.

martong accepted this revision.Jul 6 2018, 12:58 AM

LGTM!

This revision is now accepted and ready to land.Jul 6 2018, 12:58 AM
a_sidorin accepted this revision.Jul 8 2018, 3:36 PM

LGTM too. Thank you!

This revision was automatically updated to reflect the committed changes.