[llvm-bugs] [Bug 30892] New: clangASTMatchers and clangDynamicASTMatchers appear to be mutually dependent

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 2 16:34:39 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30892

            Bug ID: 30892
           Summary: clangASTMatchers and clangDynamicASTMatchers appear to
                    be mutually dependent
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vsk at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17545
  --> https://llvm.org/bugs/attachment.cgi?id=17545&action=edit
Defined-away AST matcher overloads

During a clean build of clang with -DBUILD_SHARED_LIBS=On, I get the following
link failure:

```
FAILED: lib/libclangASTMatchers.dylib
: &&
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic
-Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fmodules
-fmodules-cache-path=/Users/vk/Desktop/llvm/DA/module.cache -fcxx-modules
-gmodules -fcolor-diagnostics -fno-common -Woverloaded-virtual
-Wno-nested-anon-types -g -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
-dynamiclib -Wl,-headerpad_max_install_names  -o lib/libclangASTMatchers.dylib
-install_name @rpath/libclangASTMatchers.dylib
tools/clang/lib/ASTMatchers/CMakeFiles/clangASTMatchers.dir/ASTMatchFinder.cpp.o
tools/clang/lib/ASTMatchers/CMakeFiles/clangASTMatchers.dir/ASTMatchersInternal.cpp.o
 lib/libclangAST.dylib lib/libclangBasic.dylib lib/libLLVMSupport.dylib
-Wl,-rpath, at loader_path/../lib && :
Undefined symbols for architecture x86_64:
  "clang::ast_matchers::callExpr", referenced from:
     
clang::ast_matchers::internal::matcher_callee1Matcher::matches(clang::CallExpr
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchFinder.cpp.o
     
clang::ast_matchers::internal::matcher_callee1Matcher::matches(clang::CallExpr
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchersInternal.cpp.o
  "clang::ast_matchers::qualType", referenced from:
     
clang::ast_matchers::internal::matcher_pointsTo1Matcher::matches(clang::QualType
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchFinder.cpp.o
     
clang::ast_matchers::internal::matcher_references1Matcher::matches(clang::QualType
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchFinder.cpp.o
      clang::ast_matchers::internal::matcher_hasType1Matcher<clang::Expr,
clang::ast_matchers::internal::Matcher<clang::Decl> >::matches(clang::Expr
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchFinder.cpp.o
     
clang::ast_matchers::internal::matcher_pointsTo1Matcher::matches(clang::QualType
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchersInternal.cpp.o
     
clang::ast_matchers::internal::matcher_references1Matcher::matches(clang::QualType
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchersInternal.cpp.o
      clang::ast_matchers::internal::matcher_hasType1Matcher<clang::Expr,
clang::ast_matchers::internal::Matcher<clang::Decl> >::matches(clang::Expr
const&, clang::ast_matchers::internal::ASTMatchFinder*,
clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in
ASTMatchersInternal.cpp.o
```

Code in ASTMatchers.h appears to depend on the callExpr and qualType matchers
defined in libclangDynamicASTMatchers. I was able to link clang successfully by
defining four AST matcher overloads from ASTMatchers.h as 'return false;'. I'm
attaching that diff.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161102/97ade18e/attachment.html>


More information about the llvm-bugs mailing list