This is an archive of the discontinued LLVM Phabricator instance.

Don't eagerly evaluate the TypeSourceInfo when mangling names.
ClosedPublic

Authored by zturner on Jun 24 2014, 3:41 PM.

Details

Summary

Don't eagerly evaluate the TypeSourceInfo while mangling.

A VarDecl may not have TypeSourceInfo, for example if source is
generated in-memory by another application. This patch changes
the mangler to use a default instance if the TypeSourceInfo
doesn't exist.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 10812.Jun 24 2014, 3:41 PM
zturner retitled this revision from to Don't eagerly evaluate the TypeSourceInfo when mangling names..
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added reviewers: rnk, majnemer.
zturner added a subscriber: Unknown Object (MLST).
majnemer accepted this revision.Jun 24 2014, 3:52 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 24 2014, 3:52 PM

It'd be good to include an explanation (in a comment and/or the commit
message) as to why this is necessary and untested in-tree so when someone
comes back to this they don't remove it for being unnecessary.

majnemer@ caught up with me offline and suggested a different fix, which is to simply call the getSourceRange() method of VarDecl instead of going through the TypeSourceInfo. This also solves the problem, so I will commit this fix instead as it seems more straightforward.

zturner closed this revision.Jun 24 2014, 10:45 PM
zturner updated this revision to Diff 10816.

Closed by commit rL211667 (authored by @zturner).