[cfe-commits] r159223 - in /cfe/trunk: include/clang-c/ include/clang/AST/ lib/AST/ test/Index/ tools/c-index-test/ tools/libclang/ unittests/ unittests/AST/

John McCall rjmccall at apple.com
Wed Jun 27 10:07:06 PDT 2012


On Jun 27, 2012, at 9:37 AM, Jordan Rose wrote:
> On Jun 27, 2012, at 9:33 , Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
>> Why not StringRefs?
> 
> Per Doug's comment:
> 
>> +  /// Contains text value associated with a token.
>> +  StringRef TextValue1;
>> +
>> +  /// Contains text value associated with a token.
>> +  StringRef TextValue2;
>> 
>> It would be nice if Token were a POD type. Could we just store ptr/length for TextValue1 and TextValue2, so that Token remains a POD?
> 
> Oops, I forgot that SourceLocation is POD (of course). Never mind.

Wait, what?  In what sense is StringRef not POD when SourceLocation is?  Neither is technically POD, because they both have a non-trivial default constructor.  However, both are trivially copyable and standard layout.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120627/d1fbaf4a/attachment.html>


More information about the cfe-commits mailing list