[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb698ad00cbc7: [clang][NFC] Rearrange Comment Token and Lexer 
fields to reduce padding (authored by njames93).

Changed prior to commit:
  https://reviews.llvm.org/D90127?vs=300623&id=300831#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

Files:
  clang/include/clang/AST/CommentLexer.h
  clang/lib/AST/CommentLexer.cpp


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,12 +740,11 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool 
ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), 
State(LS_Normal),
-  ParseCommands(ParseCommands) {}
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), ParseCommands(ParseCommands),
+  CommentState(LCS_BeforeComment), State(LS_Normal) {}
 
 void Lexer::lex(Token &T) {
 again:
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -62,13 +62,6 @@
   /// The actual kind of the token.
   tok::TokenKind Kind;
 
-  /// Length of the token spelling in comment.  Can be 0 for synthenized
-  /// tokens.
-  unsigned Length;
-
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +69,13 @@
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 
+  /// Length of the token spelling in comment.  Can be 0 for synthenized
+  /// tokens.
+  unsigned Length;
+
+  /// Contains text value associated with a token.
+  const char *TextPtr;
+
 public:
   SourceLocation getLocation() const LLVM_READONLY { return Loc; }
   void setLocation(SourceLocation SL) { Loc = SL; }
@@ -232,7 +232,6 @@
 
   const char *const BufferStart;
   const char *const BufferEnd;
-  SourceLocation FileLoc;
 
   const char *BufferPtr;
 
@@ -240,7 +239,14 @@
   /// to newline or BufferEnd, for C comments points to star in '*/'.
   const char *CommentEnd;
 
-  enum LexerCommentState {
+  SourceLocation FileLoc;
+
+  /// If true, the commands, html tags, etc will be parsed and reported as
+  /// separate tokens inside the comment body. If false, the comment text will
+  /// be parsed into text and newline tokens.
+  bool ParseCommands;
+
+  enum LexerCommentState : uint8_t {
 LCS_BeforeComment,
 LCS_InsideBCPLComment,
 LCS_InsideCComment,
@@ -250,7 +256,7 @@
   /// Low-level lexer state, track if we are inside or outside of comment.
   LexerCommentState CommentState;
 
-  enum LexerState {
+  enum LexerState : uint8_t {
 /// Lexing normal comment text
 LS_Normal,
 
@@ -280,11 +286,6 @@
   /// command, including command marker.
   SmallString<16> VerbatimBlockEndCommandName;
 
-  /// If true, the commands, html tags, etc will be parsed and reported as
-  /// separate tokens inside the comment body. If false, the comment text will
-  /// be parsed into text and newline tokens.
-  bool ParseCommands;
-
   /// Given a character reference name (e.g., "lt"), return the character that
   /// it stands for (e.g., "<").
   StringRef resolveHTMLNamedCharacterReference(StringRef Name) const;


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,12 +740,11 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), State(LS_Normal),
-  ParseCommands(ParseCommands) {}
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), ParseCommands(ParseCommands),
+  CommentState(LCS_BeforeComment), State(LS_Normal) {}
 
 void Lexer::lex(Token &T) {
 again:
Index: clang/inclu

[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.



Comment at: clang/include/clang/AST/CommentLexer.h:74
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 

Could you also swap Length and IntVal? It would be nice to keep Length and 
TextPtr next to each other.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 300623.
njames93 added a comment.

Fix field initialisation order in constructor


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

Files:
  clang/include/clang/AST/CommentLexer.h
  clang/lib/AST/CommentLexer.cpp


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,12 +740,11 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool 
ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), 
State(LS_Normal),
-  ParseCommands(ParseCommands) {}
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), ParseCommands(ParseCommands),
+  CommentState(LCS_BeforeComment), State(LS_Normal) {}
 
 void Lexer::lex(Token &T) {
 again:
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +73,9 @@
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 
+  /// Contains text value associated with a token.
+  const char *TextPtr;
+
 public:
   SourceLocation getLocation() const LLVM_READONLY { return Loc; }
   void setLocation(SourceLocation SL) { Loc = SL; }
@@ -232,7 +232,6 @@
 
   const char *const BufferStart;
   const char *const BufferEnd;
-  SourceLocation FileLoc;
 
   const char *BufferPtr;
 
@@ -240,7 +239,14 @@
   /// to newline or BufferEnd, for C comments points to star in '*/'.
   const char *CommentEnd;
 
-  enum LexerCommentState {
+  SourceLocation FileLoc;
+
+  /// If true, the commands, html tags, etc will be parsed and reported as
+  /// separate tokens inside the comment body. If false, the comment text will
+  /// be parsed into text and newline tokens.
+  bool ParseCommands;
+
+  enum LexerCommentState : uint8_t {
 LCS_BeforeComment,
 LCS_InsideBCPLComment,
 LCS_InsideCComment,
@@ -250,7 +256,7 @@
   /// Low-level lexer state, track if we are inside or outside of comment.
   LexerCommentState CommentState;
 
-  enum LexerState {
+  enum LexerState : uint8_t {
 /// Lexing normal comment text
 LS_Normal,
 
@@ -280,11 +286,6 @@
   /// command, including command marker.
   SmallString<16> VerbatimBlockEndCommandName;
 
-  /// If true, the commands, html tags, etc will be parsed and reported as
-  /// separate tokens inside the comment body. If false, the comment text will
-  /// be parsed into text and newline tokens.
-  bool ParseCommands;
-
   /// Given a character reference name (e.g., "lt"), return the character that
   /// it stands for (e.g., "<").
   StringRef resolveHTMLNamedCharacterReference(StringRef Name) const;


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,12 +740,11 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), State(LS_Normal),
-  ParseCommands(ParseCommands) {}
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), ParseCommands(ParseCommands),
+  CommentState(LCS_BeforeComment), State(LS_Normal) {}
 
 void Lexer::lex(Token &T) {
 again:
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains 

[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments.



Comment at: clang/include/clang/AST/CommentLexer.h:244
+  /// command, including command marker.
+  SmallString<16> VerbatimBlockEndCommandName;
+

gribozavr2 wrote:
> I'm not a fan of this change to `Lexer` because it breaks the grouping of 
> fields: `VerbatimBlockEndCommandName` is no longer next to `State`.
> 
> There is only ever one `Lexer` class instance anyway, so any memory savings 
> are not important I think.
Fair point, I've fixed that grouping of fields while keeping the smaller size, 
but if you think its still not worth it, I'll revert that change.
The token class size change would be worth it as they appear in vectors.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 300622.
njames93 added a comment.

Keep VerbatimBlockEndCommandName after LexerState while preserving smaller size


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

Files:
  clang/include/clang/AST/CommentLexer.h
  clang/lib/AST/CommentLexer.cpp


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,11 +740,10 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool 
ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), 
State(LS_Normal),
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), CommentState(LCS_BeforeComment), State(LS_Normal),
   ParseCommands(ParseCommands) {}
 
 void Lexer::lex(Token &T) {
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +73,9 @@
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 
+  /// Contains text value associated with a token.
+  const char *TextPtr;
+
 public:
   SourceLocation getLocation() const LLVM_READONLY { return Loc; }
   void setLocation(SourceLocation SL) { Loc = SL; }
@@ -232,7 +232,6 @@
 
   const char *const BufferStart;
   const char *const BufferEnd;
-  SourceLocation FileLoc;
 
   const char *BufferPtr;
 
@@ -240,7 +239,14 @@
   /// to newline or BufferEnd, for C comments points to star in '*/'.
   const char *CommentEnd;
 
-  enum LexerCommentState {
+  SourceLocation FileLoc;
+
+  /// If true, the commands, html tags, etc will be parsed and reported as
+  /// separate tokens inside the comment body. If false, the comment text will
+  /// be parsed into text and newline tokens.
+  bool ParseCommands;
+
+  enum LexerCommentState : uint8_t {
 LCS_BeforeComment,
 LCS_InsideBCPLComment,
 LCS_InsideCComment,
@@ -250,7 +256,7 @@
   /// Low-level lexer state, track if we are inside or outside of comment.
   LexerCommentState CommentState;
 
-  enum LexerState {
+  enum LexerState : uint8_t {
 /// Lexing normal comment text
 LS_Normal,
 
@@ -280,11 +286,6 @@
   /// command, including command marker.
   SmallString<16> VerbatimBlockEndCommandName;
 
-  /// If true, the commands, html tags, etc will be parsed and reported as
-  /// separate tokens inside the comment body. If false, the comment text will
-  /// be parsed into text and newline tokens.
-  bool ParseCommands;
-
   /// Given a character reference name (e.g., "lt"), return the character that
   /// it stands for (e.g., "<").
   StringRef resolveHTMLNamedCharacterReference(StringRef Name) const;


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,11 +740,10 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), State(LS_Normal),
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), CommentState(LCS_BeforeComment), State(LS_Normal),
   ParseCommands(ParseCommands) {}
 
 void Lexer::lex(Token &T) {
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +73,9 @@
   /// contains 

[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments.



Comment at: clang/include/clang/AST/CommentLexer.h:244
+  /// command, including command marker.
+  SmallString<16> VerbatimBlockEndCommandName;
+

I'm not a fan of this change to `Lexer` because it breaks the grouping of 
fields: `VerbatimBlockEndCommandName` is no longer next to `State`.

There is only ever one `Lexer` class instance anyway, so any memory savings are 
not important I think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90127/new/

https://reviews.llvm.org/D90127

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D90127: [clang][NFC] Rearrange Comment Token and Lexer fields to reduce padding

2020-10-25 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision.
njames93 added a reviewer: gribozavr2.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
njames93 requested review of this revision.

Rearrange the fields to reduce the size of the classes


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90127

Files:
  clang/include/clang/AST/CommentLexer.h
  clang/lib/AST/CommentLexer.cpp


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,11 +740,10 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool 
ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), 
State(LS_Normal),
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), CommentState(LCS_BeforeComment), State(LS_Normal),
   ParseCommands(ParseCommands) {}
 
 void Lexer::lex(Token &T) {
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +73,9 @@
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 
+  /// Contains text value associated with a token.
+  const char *TextPtr;
+
 public:
   SourceLocation getLocation() const LLVM_READONLY { return Loc; }
   void setLocation(SourceLocation SL) { Loc = SL; }
@@ -232,7 +232,6 @@
 
   const char *const BufferStart;
   const char *const BufferEnd;
-  SourceLocation FileLoc;
 
   const char *BufferPtr;
 
@@ -240,7 +239,13 @@
   /// to newline or BufferEnd, for C comments points to star in '*/'.
   const char *CommentEnd;
 
-  enum LexerCommentState {
+  /// If State is LS_VerbatimBlock, contains the name of verbatim end
+  /// command, including command marker.
+  SmallString<16> VerbatimBlockEndCommandName;
+
+  SourceLocation FileLoc;
+
+  enum LexerCommentState : uint8_t {
 LCS_BeforeComment,
 LCS_InsideBCPLComment,
 LCS_InsideCComment,
@@ -250,7 +255,7 @@
   /// Low-level lexer state, track if we are inside or outside of comment.
   LexerCommentState CommentState;
 
-  enum LexerState {
+  enum LexerState : uint8_t {
 /// Lexing normal comment text
 LS_Normal,
 
@@ -276,10 +281,6 @@
   /// Current lexing mode.
   LexerState State;
 
-  /// If State is LS_VerbatimBlock, contains the name of verbatim end
-  /// command, including command marker.
-  SmallString<16> VerbatimBlockEndCommandName;
-
   /// If true, the commands, html tags, etc will be parsed and reported as
   /// separate tokens inside the comment body. If false, the comment text will
   /// be parsed into text and newline tokens.


Index: clang/lib/AST/CommentLexer.cpp
===
--- clang/lib/AST/CommentLexer.cpp
+++ clang/lib/AST/CommentLexer.cpp
@@ -740,11 +740,10 @@
 
 Lexer::Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
  const CommandTraits &Traits, SourceLocation FileLoc,
- const char *BufferStart, const char *BufferEnd,
- bool ParseCommands)
+ const char *BufferStart, const char *BufferEnd, bool ParseCommands)
 : Allocator(Allocator), Diags(Diags), Traits(Traits),
-  BufferStart(BufferStart), BufferEnd(BufferEnd), FileLoc(FileLoc),
-  BufferPtr(BufferStart), CommentState(LCS_BeforeComment), State(LS_Normal),
+  BufferStart(BufferStart), BufferEnd(BufferEnd), BufferPtr(BufferStart),
+  FileLoc(FileLoc), CommentState(LCS_BeforeComment), State(LS_Normal),
   ParseCommands(ParseCommands) {}
 
 void Lexer::lex(Token &T) {
Index: clang/include/clang/AST/CommentLexer.h
===
--- clang/include/clang/AST/CommentLexer.h
+++ clang/include/clang/AST/CommentLexer.h
@@ -66,9 +66,6 @@
   /// tokens.
   unsigned Length;
 
-  /// Contains text value associated with a token.
-  const char *TextPtr;
-
   /// Integer value associated with a token.
   ///
   /// If the token is a known command, contains command ID and TextPtr is
@@ -76,6 +73,9 @@
   /// contains the length of the string that starts at TextPtr.
   unsigned IntVal;
 
+  /// Contains text value associated with a token.
+  const