[cfe-commits] r101953 - /cfe/trunk/lib/AST/Decl.cpp
Douglas Gregor
dgregor at apple.com
Tue Apr 20 22:56:23 PDT 2010
On Apr 20, 2010, at 5:20 PM, Fariborz Jahanian wrote:
>
> On Apr 20, 2010, at 4:59 PM, Douglas Gregor wrote:
>
>>
>> On Apr 20, 2010, at 4:24 PM, Fariborz Jahanian wrote:
>>
>>>
>>> On Apr 20, 2010, at 4:15 PM, Ted Kremenek wrote:
>>>
>>>> Author: kremenek
>>>> Date: Tue Apr 20 18:15:35 2010
>>>> New Revision: 101953
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=101953&view=rev
>>>> Log:
>>>> Specify linkage for Objective-C declarations.
>>>
>>> This makes me uncomfortable. This looks like something you need to
>>> move the indexer forward (your next patch). Maybe you need to add
>>> a new psuedo_linkage for your purpose.
>>
>> Can you explain a bit about why this makes you uncomfortable? From my perspective, all of the Objective-C declarations have external linkage since they are visible from multiple translation units.
>
> Except for meta-data for the class (and its metaclass), othere meta-data have non-external linkage.
> Content of all non-external metadata, however, can be inspected with various APIs. In that respect they are 'external'.
> But not wrt linkage.
I'm looking at linkage more from the language perspective. For example, say we have:
@interface A
@end
A *an_A;
Is this code well-formed? In C++, it actually depends on the linkage of A: if A has no linkage, then the program is ill-formed because an_A does have linkage. Also, one could imagine instantiating a template over an Objective-C class (or pointer to one), e.g.,
std::vector<A *> a_objects;
which also requires A to have linkage.
- Doug
More information about the cfe-commits
mailing list