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 | ||
---|---|---|
11 | A blank line between define guard and include. | |
17 | Could you add a few documentation describing this interface? | |
21 | A blank line below. | |
clang-tidy/utils/NamespaceAliaser.cpp | ||
8 | A blank line. | |
14 | A blank line below. | |
41 | FIXME. | |
44 | FIXME. | |
85 | I'd prefer to declare it const auto *. | |
clang-tidy/utils/NamespaceAliaser.h | ||
8 | A blank line. | |
21 | A blank line below. | |
28 | s/these/there? | |
41 | Use llvm::DenseMap instead. | |
clang-tidy/utils/UsingInserter.cpp | ||
49 | Use FIXME instead of TODO(bangert). | |
clang-tidy/utils/UsingInserter.h | ||
23 | Could you elaborate a bit more? | |
41 | 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 | ||
---|---|---|
59 | 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.