[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-project/creduce] 95b328: Fix hardcoded C++ flag and compatibility with newe...



  Branch: refs/heads/master
  Home:   https://github.com/csmith-project/creduce
  Commit: 95b328d033a17502771ffb78009ee5a9df2d0e07
      https://github.com/csmith-project/creduce/commit/95b328d033a17502771ffb78009ee5a9df2d0e07
  Author: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
  Date:   2023-11-25 (Sat, 25 Nov 2023)

  Changed paths:
    M CMakeLists.txt
    M clang_delta/RemoveUnusedStructField.cpp

  Log Message:
  -----------
  Fix hardcoded C++ flag and compatibility with newer llvm versions

* A minor change to be compatible with LLVM >=17 as well as the older versions
  - credit to @mizvekov for #264
* Avoid hardcoding C++ standard flag via "-std=XX"
  - a newer version of LLVM requires newer C++ standards.
  - based on the llvm version, use specific C++ standards and let cmake add an appropriate flag.

  Otherwise, compiling the master branch with the latest LLVM ends with errors like the following:

```console
[  1%] Building CXX object clang_delta/CMakeFiles/clang_delta.dir/AggregateToScalar.cpp.o
cd /home/kumbhar/workarena/repos/external/creduce/build/clang_delta && /usr/bin/c++ -DHAVE_CONFIG_H -DNDEBUG -I/home/kumbhar/workarena/repos/external/creduce/build -I/home/kumbhar/workarena/repos/external/creduce/clang_delta -I/home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include -std=c++11 -fno-rtti -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility-inlines-hidden -O3 -DNDEBUG -O3   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT clang_delta/CMakeFiles/clang_delta.dir/AggregateToScalar.cpp.o -MF CMakeFiles/clang_delta.dir/AggregateToScalar.cpp.o.d -o CMakeFiles/clang_delta.dir/AggregateToScalar.cpp.o -c /home/kumbhar/workarena/repos/external/creduce/clang_delta/AggregateToScalar.cpp
In file included from /home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include/llvm/ADT/DenseMap.h:17,
                 from /home/kumbhar/workarena/repos/external/creduce/clang_delta/AggregateToScalar.h:16,
                 from /home/kumbhar/workarena/repos/external/creduce/clang_delta/AggregateToScalar.cpp:15:
/home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include/llvm/ADT/DenseMapInfo.h: In static member function ‘static unsigned int llvm::DenseMapInfo<std::tuple<_Tps ...> >::getHashValueImpl(const Tuple&, std::false_type)’:
/home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include/llvm/ADT/DenseMapInfo.h:264:26: error: ‘tuple_element_t’ in namespace ‘std’ does not name a template type
  264 |     using EltType = std::tuple_element_t<I, Tuple>;
      |                          ^~~~~~~~~~~~~~~
/home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include/llvm/ADT/DenseMapInfo.h:264:21: note: ‘std::tuple_element_t’ is only available from C++14 onwards
  264 |     using EltType = std::tuple_element_t<I, Tuple>;
      |                     ^~~
/home/kumbhar/workarena/repos/bbp/spack_upstream/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/llvm-17.0.4-j6r4bktrzjs6x22pxkreb6p2kpogib2j/include/llvm/ADT/DenseMapInfo.h:267:22: error: ‘EltType’ was not declared in this scope
  267 |         DenseMapInfo<EltType>::getHashValue(std::get<I>(values)),
```

superseded #264

Co-authored-by: Matheus Izvekov <mizvekov@gmail.com>


  Commit: a4f6cf3689d44513fd944b1090ca8fd6d5ae8cd5
      https://github.com/csmith-project/creduce/commit/a4f6cf3689d44513fd944b1090ca8fd6d5ae8cd5
  Author: Yang Chen <chenyang@cs.utah.edu>
  Date:   2023-12-11 (Mon, 11 Dec 2023)

  Changed paths:
    M CMakeLists.txt
    M clang_delta/RemoveUnusedStructField.cpp

  Log Message:
  -----------
  Merge pull request #270 from pramodk/pramodk/llvm-cpp-flags-fixes

Fix hardcoded C++ flag and compatibility with newer llvm versions


Compare: https://github.com/csmith-project/creduce/compare/e9a440e59501...a4f6cf3689d4