head 1.8; access; symbols pkgsrc-2024Q4:1.7.0.28 pkgsrc-2024Q4-base:1.7 pkgsrc-2024Q3:1.7.0.26 pkgsrc-2024Q3-base:1.7 pkgsrc-2024Q2:1.7.0.24 pkgsrc-2024Q2-base:1.7 pkgsrc-2024Q1:1.7.0.22 pkgsrc-2024Q1-base:1.7 pkgsrc-2023Q4:1.7.0.20 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.18 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.16 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.14 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.12 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.10 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.8 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.6 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.7.0.4 pkgsrc-2021Q4-base:1.7 pkgsrc-2021Q3:1.7.0.2 pkgsrc-2021Q3-base:1.7 pkgsrc-2021Q2:1.6.0.10 pkgsrc-2021Q2-base:1.6 pkgsrc-2021Q1:1.6.0.8 pkgsrc-2021Q1-base:1.6 pkgsrc-2020Q4:1.6.0.6 pkgsrc-2020Q4-base:1.6 pkgsrc-2020Q3:1.6.0.4 pkgsrc-2020Q3-base:1.6 pkgsrc-2020Q2:1.6.0.2 pkgsrc-2020Q2-base:1.6 pkgsrc-2019Q1:1.4.0.4 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.2 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q2:1.2.0.4 pkgsrc-2018Q2-base:1.2 pkgsrc-2018Q1:1.2.0.2 pkgsrc-2018Q1-base:1.2 pkgsrc-2017Q4:1.1.0.12 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.10 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.6 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.4 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.2 pkgsrc-2016Q4-base:1.1; locks; strict; comment @// @; 1.8 date 2025.01.24.09.37.18; author wiz; state dead; branches; next 1.7; commitid 1BEGVL34Rb5FIIGF; 1.7 date 2021.07.14.09.08.49; author wiz; state Exp; branches; next 1.6; commitid TrTLpM6xR2eJ1W0D; 1.6 date 2020.04.20.16.33.51; author adam; state Exp; branches; next 1.5; commitid sVzArTP9jQpoX85C; 1.5 date 2019.06.02.09.07.39; author adam; state dead; branches; next 1.4; commitid QJd09XkyBJBTRApB; 1.4 date 2018.12.12.12.44.43; author adam; state Exp; branches; next 1.3; commitid Y9b5PRFKjw3hBv3B; 1.3 date 2018.08.07.11.14.20; author adam; state dead; branches; next 1.2; commitid SGq7JNGik3kibbNA; 1.2 date 2018.03.31.20.09.10; author joerg; state Exp; branches; next 1.1; commitid 9DWntHYDHqiPhEwA; 1.1 date 2016.11.18.18.20.05; author joerg; state Exp; branches; next ; commitid vUQxY2IZTdoSGDuz; desc @@ 1.8 log @creduce: remove BROKEN for years since it doesn't keep up-to-date with llvm, dead upstream. If you're using this, try devel/cvise instead @ text @$NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.7 2021/07/14 09:08:49 wiz Exp $ Build fix for llvm 12.0.1 from https://github.com/csmith-project/creduce/tree/llvm-12.0-dev --- clang_delta/TransformationManager.cpp.orig 2019-05-13 21:17:30.000000000 +0000 +++ clang_delta/TransformationManager.cpp @@@@ -16,9 +16,12 @@@@ #include +#include "clang/Basic/Builtins.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/TargetInfo.h" #include "clang/Lex/Preprocessor.h" +#include "clang/Lex/PreprocessorOptions.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Parse/ParseAST.h" @@@@ -101,16 +104,16 @@@@ bool TransformationManager::initializeCo CompilerInvocation &Invocation = ClangInstance->getInvocation(); InputKind IK = FrontendOptions::getInputKindForExtension( StringRef(SrcFileName).rsplit('.').second); - if (IK.getLanguage() == InputKind::C) { - Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); + if (IK.getLanguage() == Language::C) { + Invocation.setLangDefaults(ClangInstance->getLangOpts(), Language::C, T, PPOpts.Includes); } - else if (IK.getLanguage() == InputKind::CXX) { + else if (IK.getLanguage() == Language::CXX) { // ISSUE: it might cause some problems when building AST // for a function which has a non-declared callee, e.g., // It results an empty AST for the caller. - Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); + Invocation.setLangDefaults(ClangInstance->getLangOpts(), Language::CXX, T, PPOpts.Includes); } - else if(IK.getLanguage() == InputKind::OpenCL) { + else if(IK.getLanguage() == Language::OpenCL) { //Commandline parameters std::vector Args; Args.push_back("-x"); @@@@ -122,7 +125,7 @@@@ bool TransformationManager::initializeCo ClangInstance->createFileManager(); if(CLCPath != NULL && ClangInstance->hasFileManager() && - ClangInstance->getFileManager().getDirectory(CLCPath, false) != NULL) { + ClangInstance->getFileManager().getDirectory(CLCPath, false)) { Args.push_back("-I"); Args.push_back(CLCPath); } @@@@ -132,10 +135,10 @@@@ bool TransformationManager::initializeCo Args.push_back("-fno-builtin"); CompilerInvocation::CreateFromArgs(Invocation, - &Args[0], &Args[0] + Args.size(), + ArrayRef(&Args[0], &Args[0] + Args.size()), ClangInstance->getDiagnostics()); Invocation.setLangDefaults(ClangInstance->getLangOpts(), - InputKind::OpenCL, T, PPOpts); + Language::OpenCL, T, PPOpts.Includes); } else { ErrorMsg = "Unsupported file type!"; @ 1.7 log @creduce: fix build with llvm-12 From https://github.com/csmith-project/creduce/tree/llvm-12.0-dev @ text @d1 1 a1 1 $NetBSD$ @ 1.6 log @creduce: port to LLVM 10 @ text @d3 1 a3 2 Port to LLVM 10.0 https://github.com/csmith-project/creduce/pull/204/ d7 1 a7 1 @@@@ -16,6 +16,7 @@@@ d13 1 d16 5 a20 1 @@@@ -101,6 +102,7 @@@@ bool TransformationManager::initializeCo d24 4 a27 3 +#if LLVM_VERSION_MAJOR < 10 if (IK.getLanguage() == InputKind::C) { Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); d29 7 a35 2 @@@@ -111,6 +113,18 @@@@ bool TransformationManager::initializeCo Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); d37 1 a37 11 else if(IK.getLanguage() == InputKind::OpenCL) { +#else + if (IK.getLanguage() == Language::C) { + Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::C), T, PPOpts); + } + else if (IK.getLanguage() == Language::CXX) { + // ISSUE: it might cause some problems when building AST + // for a function which has a non-declared callee, e.g., + // It results an empty AST for the caller. + Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::CXX), T, PPOpts); + } a38 1 +#endif d42 1 a42 1 @@@@ -122,7 +136,7 @@@@ bool TransformationManager::initializeCo d51 1 a51 1 @@@@ -132,10 +146,19 @@@@ bool TransformationManager::initializeCo d55 2 a56 5 +#if LLVM_VERSION_MAJOR >= 10 + Args, +#else &Args[0], &Args[0] + Args.size(), +#endif d60 1 a60 6 +#if LLVM_VERSION_MAJOR >= 10 + InputKind(Language::OpenCL), +#else + InputKind::OpenCL, +#endif + T, PPOpts); @ 1.5 log @creduce: updated to 2.10.0 No news is good news. @ text @d1 1 a1 1 $NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.4 2018/12/12 12:44:43 adam Exp $ d3 2 a4 2 Fix for LLVM 7.0. https://github.com/csmith-project/creduce/tree/llvm-7.0 d6 1 a6 1 --- clang_delta/TransformationManager.cpp.orig 2018-12-12 12:37:38.000000000 +0000 d8 1 a8 1 @@@@ -223,7 +223,7 @@@@ llvm::raw_ostream *TransformationManager d10 63 a72 7 std::error_code EC; llvm::raw_fd_ostream *Out = new llvm::raw_fd_ostream( - OutputFileName, EC, llvm::sys::fs::F_RW); + OutputFileName, EC, llvm::sys::fs::FA_Read | llvm::sys::fs::FA_Write); assert(!EC && "Cannot open output file!"); return Out; } @ 1.4 log @creduce: fix for LLVM 7.0 @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @creduce: updated to 2.8.0 2.8.0: No news is good news. @ text @d1 1 a1 1 $NetBSD: patch-clang__delta_TransformationManager.cpp,v 1.2 2018/03/31 20:09:10 joerg Exp $ d3 4 a6 1 --- clang_delta/TransformationManager.cpp.orig 2018-03-31 19:32:59.198705133 +0000 d8 9 a16 35 @@@@ -99,18 +99,18 @@@@ bool TransformationManager::initializeCo } llvm::Triple T(TargetOpts.Triple); CompilerInvocation &Invocation = ClangInstance->getInvocation(); - InputKind IK = FrontendOptions::getInputKindForExtension( - StringRef(SrcFileName).rsplit('.').second); - if ((IK == IK_C) || (IK == IK_PreprocessedC)) { - Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C, T, PPOpts); + InputKind::Language IK = FrontendOptions::getInputKindForExtension( + StringRef(SrcFileName).rsplit('.').second).getLanguage(); + if (IK == InputKind::C) { + Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); } - else if ((IK == IK_CXX) || (IK == IK_PreprocessedCXX)) { + else if (IK == InputKind::CXX) { // ISSUE: it might cause some problems when building AST // for a function which has a non-declared callee, e.g., // It results an empty AST for the caller. - Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_CXX, T, PPOpts); + Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); } - else if(IK == IK_OpenCL) { + else if(IK == InputKind::OpenCL) { //Commandline parameters std::vector Args; Args.push_back("-x"); @@@@ -135,7 +135,7 @@@@ bool TransformationManager::initializeCo &Args[0], &Args[0] + Args.size(), ClangInstance->getDiagnostics()); Invocation.setLangDefaults(ClangInstance->getLangOpts(), - IK_OpenCL, T, PPOpts); + InputKind::OpenCL, T, PPOpts); } else { ErrorMsg = "Unsupported file type!"; @ 1.2 log @Update creduce to 2.7.0 and apply some additional clang interface changes. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Fix for API changes in Clang 3.9. @ text @d3 1 a3 1 --- clang_delta/TransformationManager.cpp.orig 2016-11-17 01:58:56.000000000 +0000 d5 1 a5 23 @@@@ -82,6 +82,16 @@@@ bool TransformationManager::initializeCo ClangInstance = new CompilerInstance(); assert(ClangInstance); + + TargetOptions &TargetOpts = ClangInstance->getTargetOpts(); + PreprocessorOptions &PPOpts = ClangInstance->getPreprocessorOpts(); + + if (const char *env = getenv("CREDUCE_TARGET_TRIPLE")) { + TargetOpts.Triple = std::string(env); + } else { + TargetOpts.Triple = LLVM_DEFAULT_TARGET_TRIPLE; + } + llvm::Triple Triple(TargetOpts.Triple); ClangInstance->createDiagnostics(); @@@@ -89,13 +99,13 @@@@ bool TransformationManager::initializeCo InputKind IK = FrontendOptions::getInputKindForExtension( StringRef(SrcFileName).rsplit('.').second); if ((IK == IK_C) || (IK == IK_PreprocessedC)) { - Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C); + Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C, Triple, PPOpts); d7 13 a19 1 else if ((IK == IK_CXX) || (IK == IK_PreprocessedCXX)) { d23 2 a24 2 - Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_CXX); + Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_CXX, Triple, PPOpts); d26 2 a27 1 else if(IK == IK_OpenCL) { d29 3 a31 2 @@@@ -121,21 +131,13 @@@@ bool TransformationManager::initializeCo CompilerInvocation::CreateFromArgs(Invocation, d34 3 a36 2 - Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_OpenCL); + Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_OpenCL, Triple, PPOpts); a39 14 return false; } - TargetOptions &TargetOpts = ClangInstance->getTargetOpts(); - - if (const char *env = getenv("CREDUCE_TARGET_TRIPLE")) { - TargetOpts.Triple = std::string(env); - } else { - TargetOpts.Triple = LLVM_DEFAULT_TARGET_TRIPLE; - } - TargetInfo *Target = TargetInfo::CreateTargetInfo(ClangInstance->getDiagnostics(), ClangInstance->getInvocation().TargetOpts); @