[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 25 12:09:19 PST 2019

mgrang added a comment.

In D50488#1407884 <https://reviews.llvm.org/D50488#1407884>, @Szelethus wrote:

> In D50488#1405094 <https://reviews.llvm.org/D50488#1405094>, @mgrang wrote:
> > So I was able compile a couple of C++ code bases through csa-testbench. I built cppcheck and tinyxml2 without any problems. cppcheck has one invocation std::sort but the keys are not pointers whereas tinyxml2 does not use std::sort. I tried bitcoin, rtags, xerces but run into a lot of configure/build errors.
> Thats great. How about LLVM+Clang? That'll be a pain in the butt to analyze, but is pretty great for testing. Also, did you clone rtags with the git option `--recursive`?

LLVM does not directly use std::sort. It calls llvm::sort which in-turn call std::sort (but it does have std::stable_sort, etc). However, I run into a host of errors while building LLVM inside csa-testbench. Maybe, once this patch lands, I could use llvm as a bootstrap stage1 compiler with this checker enabled.

>>   Also, did you clone rtags with the git option `--recursive`?

Yes, I followed the build instructions from https://github.com/Andersbakken/rtags. But run into these errors:

  ./configure //this invokes "cmake" "." -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
    The compiler uses a libstdc++ without c++11 regex support.
  ./configure --clang-cxxflags '-std=c++11' //this invokes "cmake" "." -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DLIBCLANG_CXXFLAGS="-std=c++11"
    It's likely that the include file <clang-c/Index.h> could not be found!

I tried installing libclang-dev, libclang-3.8-dev, libclang-6.0-dev as well as adding -I include paths for clang-c to configure but I am not able to go past the above error.

  rC Clang



More information about the cfe-commits mailing list