<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Replying on cfe-dev.<br></div>
<div> </div>
<div>Your issue is most confusing. You will need to show us the matcher code you're trying to get working.<br></div>
<div> </div>
<div>By the way, you do not need to place your own matchers in ASTMatchers.h, you can create an own header file, like so:<br></div>
<div> </div>
<div>#include "clang/ASTMatchers/ASTMatchersMacros.h"<br></div>
<div>#include "clang/ASTMatchers/ASTMatchersInternal.h"<br></div>
<div> </div>
<div>namespace clang {<br></div>
<div>namespace ast_matchers {<br></div>
<div> </div>
<div>// your matchers here<br></div>
<div> </div>
<div>} // end namespace ast_matchers<br></div>
<div>} // end namespace clang<br></div>
<div> </div>
<div>Do not forget the header guard of course and anything else you may need.<br></div>
<div> </div>
<div>As for your build issues: try doing a clean rebuild, i.e. reconfigure (or run cmake again), and then make. I have never used ninja, so no idea if the issue could be on that front. Also make sure that you've not accidentally corrupted your LLVM/Clang checkout... But I hope you already tried these.<br></div>
<div> </div>
<div id="sig19426269"><div class="signature">-- <br></div>
<div class="signature">  Gábor Kozár -- ShdNx<br></div>
<div class="signature">  kozargabor@gmail.com<br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Thu, Sep 26, 2013, at 11:29, Pedro Delgado Perez wrote:<br></div>
<blockquote type="cite"><p>Hi Gábor,<br></p><p>Sorry to write you directly, but I don't know why I can't post messages in cfe-dev...<br></p><p>I get through you because, some months ago, you told me what could I do when a matcher in <a href="http://clang.llvm.org/docs/LibASTMatchersReference.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersReference.html</a><br></p><div defang_dir="" class="">
was no present in my ASTMatchers.h.<br></div>
<p>Now, I'm trying to integrate the matcher forEachConstructorInitializer in<br></p><div defang_dir="" class="">
<a href="http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h" target="_blank">http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h</a><br></div>
<p>Firstly, I have included it in my ASTMatchers, but I don't know why the system is not recognizing this new matcher. So I have put it in my own source file. Now, the system gives me the next problem and I would like to know how could I solve this:<br></p><p>CTD_operator.cpp:42:29: error: calling a private constructor of class 'clang::ast_matchers::internal::BoundNodesTreeBuilder'<br></p><div defang_dir="" class="">             BoundNodesTreeBuilder InitBuilder(*Builder);<br></div>
<div defang_dir="" class="">                                   ^<br></div>
<div defang_dir="" class="">/usr/local/include/clang/ASTMatchers/ASTMatchersInternal.h:178:3: note: declared private here<br></div>
<div defang_dir="" class="">  BoundNodesTreeBuilder(const BoundNodesTreeBuilder &) LLVM_DELETED_FUNCTION;<br></div>
<div defang_dir="" class="">  ^<br></div>
<div defang_dir="" class="">CTD_operator.cpp:45:25: error: no viable conversion from 'clang::ast_matchers::internal::BoundNodesTreeBuilder' to 'const clang::ast_matchers::internal::BoundNodesTree'<br></div>
<div defang_dir="" class="">               Result.addMatch(InitBuilder);<br></div>
<div defang_dir="" class="">                               ^~~~~~~~~~~<br></div>
<div defang_dir="" class="">/usr/local/include/clang/ASTMatchers/ASTMatchersInternal.h:113:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from<br></div>
<div defang_dir="" class="">      'clang::ast_matchers::internal::BoundNodesTreeBuilder' to 'const clang::ast_matchers::internal::BoundNodesTree &' for 1st argument<br></div>
<div defang_dir="" class="">class BoundNodesTree {<br></div>
<div defang_dir="" class="">      ^<br></div>
<div defang_dir="" class="">/usr/local/include/clang/ASTMatchers/ASTMatchersInternal.h:172:39: note: passing argument to parameter 'Bindings' here<br></div>
<div defang_dir="" class="">  void addMatch(const BoundNodesTree& Bindings);<br></div>
<div defang_dir="" class="">                                      ^<br></div>
<div defang_dir="" class="">CTD_operator.cpp:48:14: error: 'operator=' is a private member of 'clang::ast_matchers::internal::BoundNodesTreeBuilder'<br></div>
<div defang_dir="" class="">           *Builder = Result;<br></div>
<div defang_dir="" class="">           ~~~~~~~~ ^ ~~~~~~<br></div>
<div defang_dir="" class="">/usr/local/include/clang/ASTMatchers/ASTMatchersInternal.h:179:8: note: declared private here<br></div>
<div defang_dir="" class="">  void operator=(const BoundNodesTreeBuilder &) LLVM_DELETED_FUNCTION;<br></div>
<div defang_dir="" class="">       ^<br></div>
<div defang_dir="" class=""> </div>
<p>Should I also change ASTMatchersInternal.h?? Do you recommend me to replace these header files for the last version?<br></p><p>How can I achieve that the system is aware of the changes I introduce in these files? I have a Makefile and only write "make" from the shell... Since two days ago, I was using ninja, but I don't know why, suddenly, start giving this fail:<br></p><p>pedro@hal ~/clang-llvm/build $ ninja<br></p><p>[6/745] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o<br></p><div defang_dir="" class="">FAILED: /usr/local/bin/clang++   -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -fcolor-diagnostics -fno-rtti  -Ilib/Target/Hexagon -I/home/pedro/clang-llvm/llvm/lib/Target/Hexagon -Iinclude -I/home/pedro/clang-llvm/llvm/include    -fno-exceptions -fno-exceptions -MMD -MT lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o -MF "lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o.d" -o lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o -c /home/pedro/clang-llvm/llvm/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp<br></div>
<div defang_dir="" class="">error: unable to open output file 'lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o': 'Error opening output file 'lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRemoveSZExtArgs.cpp.o''<br></div>
<div defang_dir="" class="">1 error generated.<br></div>
<div defang_dir="" class="">[6/745] Linking CXX static library lib/libLLVMInstrumentation.a<br></div>
<div defang_dir="" class="">ninja: build stopped: subcommand failed.<br></div>
<div defang_dir="" class=""> </div>
<div defang_dir="" class=""> </div>
<div defang_dir="" class="">
I don't know what is "HexagonRemoveSZExtArgs.cpp.o" :S<br></div>
<p>Thanks,<br></p><p>Pedro.<br></p></blockquote></body>
</html>