This adds helper classes to add using declaractions and namespace aliases to function bodies. These help making function calls to deeply nested functions concise (e.g. when calling helpers in a refactoring)
Details
- Reviewers
hokein alexfh - Commits
- rGada286202e2b: Recommit "[ClangTidy] Add UsingInserter and NamespaceAliaser"
rG6c24d9345d13: [ClangTidy] Add UsingInserter and NamespaceAliaser
rCTE284368: Recommit "[ClangTidy] Add UsingInserter and NamespaceAliaser"
rCTE283981: [ClangTidy] Add UsingInserter and NamespaceAliaser
rL284368: Recommit "[ClangTidy] Add UsingInserter and NamespaceAliaser"
rL283981: [ClangTidy] Add UsingInserter and NamespaceAliaser
Diff Detail
Event Timeline
Looks almost fine, a few code-style comments.
clang-tidy/utils/ASTUtils.h | ||
---|---|---|
12 | A blank line between define guard and include. | |
18 | Could you add a few documentation describing this interface? | |
22 | A blank line below. | |
clang-tidy/utils/NamespaceAliaser.cpp | ||
9 | A blank line. | |
15 | A blank line below. | |
42 | FIXME. | |
45 | FIXME. | |
86 | I'd prefer to declare it const auto *. | |
clang-tidy/utils/NamespaceAliaser.h | ||
9 | A blank line. | |
22 | A blank line below. | |
29 | s/these/there? | |
42 | Use llvm::DenseMap instead. | |
clang-tidy/utils/UsingInserter.cpp | ||
50 | Use FIXME instead of TODO(bangert). | |
clang-tidy/utils/UsingInserter.h | ||
24 | Could you elaborate a bit more? | |
42 | It'd be clearer to use a typedef for std::pair<const FunctionDecl *, std::string> here. |
LGTM with one more nit.
clang-tidy/utils/ASTUtils.h | ||
---|---|---|
26 | missing a trailing comment // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H |
@jbangert, your patch broke the buildbot, and I reverted it in r283985. You need to add the new source files to the CMakefile. (I saw other compilation errors after I updated the cmake files, Could you take a look on it? )
clang-tidy/utils/UsingInserter.cpp | ||
---|---|---|
58 | Using emplace seems to break our modules libstdc++ 4.7 builds: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/6066 . Doesn't that break other 4.7 or earlier builds? |
A blank line between define guard and include.