[clang] 302cb3b - [Syntax] Add a comment explaining the pointer keys in std::map<Token*, ...>. NFC
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 29 00:49:47 PST 2019
Author: Ilya Biryukov
Date: 2019-11-29T09:49:24+01:00
New Revision: 302cb3bc3d7220e09f5dced64ddfdda33b9c49f9
URL: https://github.com/llvm/llvm-project/commit/302cb3bc3d7220e09f5dced64ddfdda33b9c49f9
DIFF: https://github.com/llvm/llvm-project/commit/302cb3bc3d7220e09f5dced64ddfdda33b9c49f9.diff
LOG: [Syntax] Add a comment explaining the pointer keys in std::map<Token*, ...>. NFC
Added:
Modified:
clang/lib/Tooling/Syntax/BuildTree.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/Syntax/BuildTree.cpp b/clang/lib/Tooling/Syntax/BuildTree.cpp
index b36b8e00f7c1..22cdb89b7bfb 100644
--- a/clang/lib/Tooling/Syntax/BuildTree.cpp
+++ b/clang/lib/Tooling/Syntax/BuildTree.cpp
@@ -209,6 +209,8 @@ class syntax::TreeBuilder {
};
/// Maps from the start token to a subtree starting at that token.
+ /// Keys in the map are pointers into the array of expanded tokens, so
+ /// pointer order corresponds to the order of preprocessor tokens.
/// FIXME: storing the end tokens is redundant.
/// FIXME: the key of a map is redundant, it is also stored in NodeForRange.
std::map<const syntax::Token *, NodeAndRole> Trees;
More information about the cfe-commits
mailing list