Skip to content

Commit 2b17e21

Browse files
committed
[FOLD] add comments
1 parent c12e157 commit 2b17e21

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/include/clang/Lex/Preprocessor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ class Preprocessor {
11601160
/// invoked (at which point the last position is popped).
11611161
std::vector<CachedTokensTy::size_type> BacktrackPositions;
11621162

1163+
/// Stack of cached tokens/initial number of cached tokens pairs, allowing
1164+
/// nested unannotated backtracks.
11631165
std::vector<std::pair<CachedTokensTy, CachedTokensTy::size_type>>
11641166
UnannotatedBacktrackTokens;
11651167

@@ -1725,6 +1727,8 @@ class Preprocessor {
17251727
/// at some point after EnableBacktrackAtThisPos. If you don't, caching of
17261728
/// tokens will continue indefinitely.
17271729
///
1730+
/// \param Unannotated Whether token annotations are reverted upon calling
1731+
/// Backtrack().
17281732
void EnableBacktrackAtThisPos(bool Unannotated = false);
17291733

17301734
private:
@@ -1744,6 +1748,8 @@ class Preprocessor {
17441748
/// caching of tokens is on.
17451749
bool isBacktrackEnabled() const { return !BacktrackPositions.empty(); }
17461750

1751+
/// True if EnableBacktrackAtThisPos() was called and
1752+
/// caching of unannotated tokens is on.
17471753
bool isUnannotatedBacktrackEnabled() const {
17481754
return !UnannotatedBacktrackTokens.empty();
17491755
}

clang/include/clang/Parse/Parser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,8 @@ class Parser : public CodeCompletionHandler {
10251025
/// ....
10261026
/// TPA.Revert();
10271027
///
1028+
/// If the Unannotated parameter is true, any token annotations created
1029+
/// during the tentative parse are reverted.
10281030
class TentativeParsingAction {
10291031
Parser &P;
10301032
PreferredTypeBuilder PrevPreferredType;

0 commit comments

Comments
 (0)