firolino / clang-tool Goto Github PK
View Code? Open in Web Editor NEWSimple and powerful standalone project for clang-based tools using libtooling (e.g. refactoring, auto-completion, etc.)
License: MIT License
Simple and powerful standalone project for clang-based tools using libtooling (e.g. refactoring, auto-completion, etc.)
License: MIT License
Hi, I was running your code and found out that in utils.cpp, clang::tooling::ToolInvocation don't have a function called mapVirtualFile anymore. Do you know how to fix this?
Running CMake 3.19.7 on macOS 11.1 (20C69). Have LLVM @ 4224a3
in the directory above which I built using CMake.
$ git clone https://github.com/firolino/clang-tool
cd clang-tool
mkdir build
cd build
cmake ..
make
Cloning into 'clang-tool'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 196 (delta 1), reused 3 (delta 0), pack-reused 187
Receiving objects: 100% (196/196), 28.97 KiB | 5.79 MiB/s, done.
Resolving deltas: 100% (93/93), done.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at src/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- LLVM CXX flags: /bin/sh: LLVM_CONFIG_EXECUTABLE-NOTFOUND: command not found
-- LLVM LD flags:
-- LLVM core libs: /bin/sh: LLVM_CONFIG_EXECUTABLE-NOTFOUND: command not found
-- Found LLVM: /bin/sh: LLVM_CONFIG_EXECUTABLE-NOTFOUND: command not found
-- Clang libs:
-- Configuring done
-- Generating done
-- Build files have been written to: /muh/dir/fold/clang-llvm/clang-tool/build
src/CMakeFiles/clang-tool.dir/build.make:206: *** target pattern contains no `%'. Stop.
make[1]: *** [src/CMakeFiles/clang-tool.dir/all] Error 2
make: *** [all] Error 2
clang-tool/build$make
Scanning dependencies of target clang-tool
[ 11%] Building CXX object src/CMakeFiles/clang-tool.dir/main.cc.o
[ 22%] Building CXX object src/CMakeFiles/clang-tool.dir/utils/utils.cc.o
/var/tmp/clang/clang-tool/src/utils/utils.cc: In function 'bool utils::customRunToolOnCodeWithArgs(clang::FrontendAction*, const llvm::Twine&, const std::vector<std::__cxx11::basic_string >&, const llvm::Twine&, const FileContentMappings&)':
/var/tmp/clang/clang-tool/src/utils/utils.cc:28:116: error: no matching function for call to 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, clang::FrontendAction*&, clang::FileManager*)'
28 | clang::tooling::ToolInvocation invocation(getSyntaxOnlyToolArgs(args, fileNameRef), frontendAction, files.get());
| ^
In file included from /var/tmp/clang/clang-tool/src/utils/utils.h:11,
from /var/tmp/clang/clang-tool/src/utils/utils.cc:1:
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:257:3: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, clang::tooling::ToolAction*, clang::FileManager*, std::shared_ptrclang::PCHContainerOperations)'
257 | ToolInvocation(std::vectorstd::string CommandLine, ToolAction Action,
| ^~~~~~~~~~~~~~
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:257:3: note: candidate expects 4 arguments, 3 provided
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:245:3: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(std::vector<std::__cxx11::basic_string >, std::unique_ptrclang::FrontendAction, clang::FileManager, std::shared_ptrclang::PCHContainerOperations)'
245 | ToolInvocation(std::vectorstd::string CommandLine,
| ^~~~~~~~~~~~~~
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:246:50: note: no known conversion for argument 2 from 'clang::FrontendAction*' to 'std::unique_ptrclang::FrontendAction'
246 | std::unique_ptr FAction, FileManager *Files,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:232:7: note: candidate: 'clang::tooling::ToolInvocation::ToolInvocation(const clang::tooling::ToolInvocation&)'
232 | class ToolInvocation {
| ^~~~~~~~~~~~~~
/usr/lib/llvm/11/include/clang/Tooling/Tooling.h:232:7: note: candidate expects 1 argument, 3 provided
make[2]: *** [src/CMakeFiles/clang-tool.dir/build.make:122: src/CMakeFiles/clang-tool.dir/utils/utils.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:114: src/CMakeFiles/clang-tool.dir/all] Error 2
make: *** [Makefile:104: all] Error 2
Hello I tried to build your project but I reached an error.
Is there easy way to fix it?
I understand that a year and a half has passed since the publication and the clang api has changed, but still I cannot fix the error myself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.