On Wed, Sep 5, 2012 at 8:18 PM, Dmitri Gribenko <[email protected]> wrote:
> On Wed, Sep 5, 2012 at 8:13 PM, Ted Kremenek <[email protected]> wrote:
>> On Sep 5, 2012, at 10:09 AM, Matthieu Monrocq <[email protected]>
>> wrote:
>>
>> If you need to break binary compatibility, I would encourage you to go all
>> the way and make CXComment an opaque pointer. This way further changes will
>> never again require breaking binary compatibility (for this).
>>
>>
>> Agreed. We have typically not exposed details of CX* data structures in the
>> past that we wanted to extend over time.
>
> Matthieu and Ted: thank you for the idea. I was feeling the same way,
> but Index.h has lots of structures with exposed internals (with a "do
> not touch" warning for users). I will rework the patch and resubmit.
Unfortunately, this approach has its downsides. Now I can see the
rationale behind structures with exposed internals -- they are value
types and don't need a special dispose API. Opaque pointer approach
leads to a source incompatible change since then CXComment objects
would need to be disposed of properly.
So, I think that my initial approach is better since CXComment being a
value type is a very nice property. I can not guarantee that it is
completely future-proof, though. But since this change adds an
ASTContext pointer to CXComment, we can reach almost anything from
there.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits