Giter Site home page Giter Site logo

libclangmm's People

Contributors

donbcd avatar eidheim avatar oyvang avatar pluehne avatar windfisch avatar zalox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libclangmm's Issues

Memleak in clang::Index

clang::Index creates an instance of CXIndex in its constructor.
However, it will never be freed.

Suggested fix:
Add a deconstructor and call clang_disposeIndex(cx_index) in it.

LibClang error when used as submodule

On Fedora 26, CMake fails with the following output: (note: i'm using libclangmm as a submodule -- not that it should make any difference)

Searcing for libclang
CMake Error at libclangmm/src/CMakeLists.txt:12 (find_package):
  By not providing "FindLibClang.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LibClang",
  but CMake did not find one.

  Could not find a package configuration file provided by "LibClang" with any
  of the following names:

    LibClangConfig.cmake
    libclang-config.cmake

  Add the installation prefix of "LibClang" to CMAKE_PREFIX_PATH or set
  "LibClang_DIR" to a directory containing one of the above files.  If
  "LibClang" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "clang-experiments/CMakeFiles/CMakeOutput.log".

Curiously enough, Fedora provides ClangConfig.cmake (without the Lib). After modifying libclangmm's CMakeFiles to find_package(Clang), the build is successful, though I assume that breaks it for other distros.

For some reason, ClangConfig.cmake also pulls in static libLLVM as a dependency (130 MB!), although this isn't required if I link against libclang manually. Is there a way to bypass the find_package altogether and specify libclang include/lib paths manually? (preferably without modifying libclangmm's CMakeLists)

Crash, see description.

Assertion failed: (Val && "isa<> used on a null pointer"), function doit, file /tmp/llvm20150628-7874-1qnjbb2/llvm-3.6.1.src/include/llvm/Support/Casting.h, line 95.

No rule to make target

make[2]: *** No rule to make target '/usr/local/lib/libclang.so', needed by 'lib/libclangmm.so'。 stop。
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/clangmm.dir/all' failed
make[1]: *** [src/CMakeFiles/clangmm.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Warning: a large cleanup coming soon!

Main issues: circular includes, forward declarations and the library can be more c++ friendly. TranslationUnit becomes the main class with the following important methods:

clang::CodeCompleteResults get_code_completions(const std::map<std::string, std::string> &buffers, int line_number, int column);
std::vector<clang::Diagnostic> get_diagnostics();
std::unique_ptr<Tokens> get_tokens(unsigned start_offset, unsigned end_offset);

Also going to label all the CX* objects to for instance cx_tu instead of tu_.

Unit-test failures

$ ./clangmm_tests 
Running 8 test cases...
/foo/bar/libclangmm/tests/TranslationUnit_Test.cc(18): error: in "translation_unit": check tu.ReparseTranslationUnit(buffer) == 0 has failed
unknown location(0): fatal error: in "completion_string": std::invalid_argument: clangmm::CodeCompleteResults::get(unsigned i): i>=size()
/foo/bar/libclangmm/tests/CompletionString_H_Test.cc(12): last checkpoint: "completion_string" entry.
/foo/bar/libclangmm/tests/CodeCompleteResults_H_Test.cc(32): error: in "code_complete_results": check substr_found has failed
/foo/bar/libclangmm/tests/Cursor_H_Test.cc(17): error: in "cursor": check cursor.get_kind() == clangmm::Cursor::Kind::ReturnStmt has failed
/foo/bar/libclangmm/tests/Token_H_Test.cc(14): error: in "token": check tokens->size() == 32 has failed
unknown location(0): fatal error: in "token": memory access violation at address: 0x00000030: no mapping at fault address
/foo/bar/libclangmm/tests/Token_H_Test.cc(15): last checkpoint

*** 6 failures are detected in the test module "clangmm_tests"

Linux stumble 4.9.0-2-amd64 #1 SMP Debian 4.9.18-1 (2017-03-30) x86_64 GNU/Linux

$ gcc --version
gcc (Debian 6.3.0-16) 6.3.0 20170425
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang --version
clang version 3.8.1-23 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Move installation guide to docs/install.md

Please create docs/install.md in this project

  • create /docs/install.md
  • move install instructions to that file (from readme.md)
  • link to this file in readme.md in both juci++ and libclanmm project

Rename project

The naming was chosen by the convention used by gnome for writing wrappers.

The mm's stands for minusminus which since the wrappers for gnome in the late 90's where named gtk-- instad of gtkmm.

I think this convention is sort of ugly, however I'm responsible for the name. So I'd like to hear some suggestions to naming of this project. If you already like the name, why not argue for it :)

Also the lib-prefix is kind of ugly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.