Details
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 25621 Build 25620: arc lint + arc unit
Event Timeline
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
23 | I'm not certain this namespace is useful, especially when it gets imported at TU scope in ASTDumper.cpp. | |
97 | I'm not sold on the name for this class. It's a bit too generic to understand what it does. How about ASTDumpLayoutFormatter (and ASTDumpNodeFormatter for the node dumper)? | |
98–111 | I don't think these members should be public. |
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
23 |
Today that's the only place it is used. In the future that won't be true. |
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
23 | Then we can add the namespace in the future when we find a situation where we're worried about collisions? As it stands, this only provides the illusion of safety. If you really want to keep it, please pull the global using declaration. |
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
97 | Or rather, TextTreeStructure. |
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
23 |
It applies to the entire TU, so it's global as far as this compilation unit is concerned. The existing "clang" and "llvm" using declarations are a pervasive thing we do but is not the general rule for how we use namespaces. See https://llvm.org/docs/CodingStandards.html#do-not-use-using-namespace-std for more details. I think the idea of an ast dumping namespace is worth exploring, but is orthogonal to this NFC patch. If you'd like to propose putting all AST dumping functionality into its own namespace, then please propose it as a separate patch so that we don't bog this one down with discussion that's not really germane to the rest of your patch. Questions I would love to see answered in that review are: why is a namespace needed, what should go into it (for instance, does ast printing go there, or just ast dumping, or all ast output utilities, etc), and whether it's planned to be used outside of its implementation file(s). Alternatively, if you think this is germane to this patch, we can have that discussion here. |
LGTM aside from a commenting nit.
include/clang/AST/ASTDumperUtils.h | ||
---|---|---|
112 | I really like the rename, but can you update this comment to not say "dump" as that implies to me that the writing happens immediately. It might also be a kindness to add the expected function signature of Fn to the comments. |
I'm not certain this namespace is useful, especially when it gets imported at TU scope in ASTDumper.cpp.