This is an archive of the discontinued LLVM Phabricator instance.

[libTooling] Put all Transformer declarations in a single namespace.
ClosedPublic

Authored by ymandel on Oct 11 2019, 9:36 AM.

Diff Detail

Event Timeline

ymandel created this revision.Oct 11 2019, 9:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2019, 9:36 AM
gribozavr accepted this revision.Oct 11 2019, 9:40 AM

WDYT about clang::transformer? I don't see much point in the intermediate namespace. However, LGTM either way.

This revision is now accepted and ready to land.Oct 11 2019, 9:40 AM

WDYT about clang::transformer? I don't see much point in the intermediate namespace. However, LGTM either way.

Thanks for the review. I prefer clang::transformer but wasn't sure about ettiquete of introducing new namespaces under clang. If that's ok, then I'm happy to update.

I'm now starting to doubt the split into transformer (for combinators) and tooling (for the type decls). I checked and ast_matchers contains both. What do you think of my just putting all of the Transformer types + combis in the single clang::transformer namespace?

What do you think of my just putting all of the Transformer types + combis in the single clang::transformer namespace?

That would make sense to me.

ymandel updated this revision to Diff 224650.Oct 11 2019, 12:01 PM

moved all decls to clang::transformer.

ymandel retitled this revision from [libTooling] Group all Transformer combinators in a single namespace. to [libTooling] Put all Transformer declarations in a single namespace..Oct 11 2019, 12:03 PM
ymandel edited the summary of this revision. (Show Details)
ymandel updated this revision to Diff 224651.Oct 11 2019, 12:10 PM
ymandel edited the summary of this revision. (Show Details)

fix using decl.

ymandel updated this revision to Diff 224653.Oct 11 2019, 12:20 PM

remove stray newline and include.

This revision was automatically updated to reflect the committed changes.

This broke the modular build since some symbols are now ambiguous within the same Clang module.'

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2646/consoleFull#25217323649ba4694-19c4-4d7e-bec5-911270d8a58c

FAILED: tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o 
/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/Tooling -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include -Itools/clang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -Iinclude -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++14 -fmodules -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/module.cache -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o -MF tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o.d -o tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o -c /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp
While building module 'Clang_Tooling' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp:9:
In file included from <module-includes>:44:
In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/Transformer.h:14:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/RewriteRule.h:224:31: error: call to 'text' is ambiguous
  return change(std::move(S), text(""));
                              ^~~~
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/Stencil.h:145:13: note: candidate function
StencilPart text(llvm::StringRef Text);
            ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/RewriteRule.h:35:22: note: candidate function
inline TextGenerator text(std::string M) {
                     ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp:9:10: fatal error: could not build module 'Clang_Tooling'
#include "clang/Tooling/AllTUsExecution.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Can you please fix and/or revert?

aprantl added a subscriber: Bigcheese.

This should be fixed by r375003. Please let me know if that's not the case.

This broke the modular build since some symbols are now ambiguous within the same Clang module.'

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2646/consoleFull#25217323649ba4694-19c4-4d7e-bec5-911270d8a58c

FAILED: tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o 
/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/Tooling -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include -Itools/clang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -Iinclude -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++14 -fmodules -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/module.cache -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o -MF tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o.d -o tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o -c /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp
While building module 'Clang_Tooling' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp:9:
In file included from <module-includes>:44:
In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/Transformer.h:14:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/RewriteRule.h:224:31: error: call to 'text' is ambiguous
  return change(std::move(S), text(""));
                              ^~~~
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/Stencil.h:145:13: note: candidate function
StencilPart text(llvm::StringRef Text);
            ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/include/clang/Tooling/Transformer/RewriteRule.h:35:22: note: candidate function
inline TextGenerator text(std::string M) {
                     ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/clang/lib/Tooling/AllTUsExecution.cpp:9:10: fatal error: could not build module 'Clang_Tooling'
#include "clang/Tooling/AllTUsExecution.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Can you please fix and/or revert?

That line was fixed in the revision I mentioned: https://reviews.llvm.org/rL375003
Could it be that the bot hasn't picked up the revision yet?