[patch] Cleanup handling of UniqueExternalLinkage.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri May 10 19:07:44 PDT 2013


> getImplementationLinkage works for me. Presumably the intent is that this
> would continue to be the linkage-used-for-code-emission once we fix the
> various cases where getFormalLinkage does not return the
> linkage-as-specified-in-the-standard, so just a comment about
> UniqueExternalLinkage seems insufficient going forward.

No, the idea is to make UniqueExternalLinkage as much of an
implementation detail as possible. The function
getImplementationLinkage (or getRawLinkage) doesn't return the linkage
as defined by the standard *or* the one used for codegen and parts of
sema that want to reason about codegen. It returns a value that can be
used to compute both, and is an implementation detail.

getRawLinkage should only be called in places doing low level stuff
(serialization for example) or in helper functions
(hasExternalFormalLinkage, isExternallyVisible) which map our
implementation to the linkage as defined by the standard or what we
use in codegen.

Cheers,
Rafael



More information about the cfe-commits mailing list