From 8f4de7a0725a14e4ccdf5448f2748736b0fa8014 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 19 Sep 2017 11:18:50 -0500 Subject: [PATCH 01/34] DeInlineAsm: Fix reference to "SingleThread" --- libs/Passes/DeInlineAsm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/Passes/DeInlineAsm.cpp b/libs/Passes/DeInlineAsm.cpp index 2b6ada0f..39337c6d 100644 --- a/libs/Passes/DeInlineAsm.cpp +++ b/libs/Passes/DeInlineAsm.cpp @@ -36,8 +36,9 @@ class InlineAsmVisitor : public InstVisitor { // Handle "compiler barrier" idiom StringRef constraintString = inlineAsm->getConstraintString(); if (constraintString == "~{memory},~{dirflag},~{fpsr},~{flags}") { - replacement = new FenceInst( - M->getContext(), AtomicOrdering::AcquireRelease, SingleThread, &I); + replacement = + new FenceInst(M->getContext(), AtomicOrdering::AcquireRelease, + SyncScope::SingleThread, &I); } } else { SmallVector asmPieces; From 2a73c4bc1060feb4cf57a31e218dedb2883d6cf0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 19 Sep 2017 11:34:48 -0500 Subject: [PATCH 02/34] StaticCodeGen: fix setFunctionAttributes, model after upstream. (this function is from CodeGen/CommandFlags.h but takes the build options as parameters instead of looking to globals) --- libs/StaticCodeGen/StaticCodeGen.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index d0817863..333c2acf 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -67,29 +67,25 @@ static inline void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M) { for (auto &F : M) { auto &Ctx = F.getContext(); - AttributeSet Attrs = F.getAttributes(), NewAttrs; + AttributeList Attrs = F.getAttributes(); + AttrBuilder NewAttrs; if (!CPU.empty()) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "target-cpu", CPU); + NewAttrs.addAttribute( "target-cpu", CPU); if (!Features.empty()) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "target-features", Features); + NewAttrs.addAttribute("target-features", Features); if (DisableFPElim.hasValue()) - NewAttrs = NewAttrs.addAttribute( - Ctx, AttributeSet::FunctionIndex, "no-frame-pointer-elim", + NewAttrs.addAttribute("no-frame-pointer-elim", DisableFPElim.getValue() ? "true" : "false"); if (DisableTailCalls.hasValue()) - NewAttrs = NewAttrs.addAttribute( - Ctx, AttributeSet::FunctionIndex, "disable-tail-calls", + NewAttrs.addAttribute("disable-tail-calls", toStringRef(DisableTailCalls.getValue())); if (StackRealign) - NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex, - "stackrealign"); + NewAttrs.addAttribute("stackrealign"); if (TrapFuncName.hasValue()) for (auto &B : F) @@ -98,13 +94,13 @@ static inline void setFunctionAttributes(StringRef CPU, StringRef Features, if (const auto *Callee = Call->getCalledFunction()) if (Callee->getIntrinsicID() == Intrinsic::debugtrap || Callee->getIntrinsicID() == Intrinsic::trap) - Call->addAttribute(AttributeSet::FunctionIndex, + Call->addAttribute(AttributeList::FunctionIndex, Attribute::get(Ctx, "trap-func-name", TrapFuncName.getValue())); // Let NewAttrs override Attrs. - NewAttrs = Attrs.addAttributes(Ctx, AttributeSet::FunctionIndex, NewAttrs); - F.setAttributes(NewAttrs); + F.setAttributes( + Attrs.addAttributes(Ctx, AttributeList::FunctionIndex, NewAttrs)); } } From 4f0623b8ed9d114d273eb8b1cd59dd0c5215ac66 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 19 Sep 2017 11:36:29 -0500 Subject: [PATCH 03/34] StaticCodeGen: KLUDGE: fix build, emit warning so this isn't forgotten. --- libs/StaticCodeGen/StaticCodeGen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 333c2acf..11ef245a 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -268,8 +268,9 @@ std::string CompilationOptions::serializeCompilationOptions() const { // Serialize OLvl buffer += std::to_string(OLvl); // Serialize TargetOptions + errs() << "Using incomplete serialization of compilation options, FIXME!\n"; buffer += std::to_string(TOptions.PrintMachineCode); - buffer += std::to_string(TOptions.LessPreciseFPMADOption); + // buffer += std::to_string(TOptions.LessPreciseFPMADOption); buffer += std::to_string(TOptions.UnsafeFPMath); buffer += std::to_string(TOptions.NoInfsFPMath); buffer += std::to_string(TOptions.NoNaNsFPMath); @@ -282,7 +283,7 @@ std::string CompilationOptions::serializeCompilationOptions() const { buffer += std::to_string(TOptions.EnableFastISel); buffer += std::to_string(TOptions.UseInitArray); buffer += std::to_string(TOptions.DisableIntegratedAS); - buffer += std::to_string(TOptions.CompressDebugSections); + buffer += std::to_string(static_cast(TOptions.CompressDebugSections)); buffer += std::to_string(TOptions.RelaxELFRelocations); buffer += std::to_string(TOptions.FunctionSections); buffer += std::to_string(TOptions.DataSections); From 63d91314c13bf29ca16ee42c3d18b4fd6adb2533 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 19 Sep 2017 11:47:10 -0500 Subject: [PATCH 04/34] lit/deasm-barrier: fix test for new fence IR format --- test/lit/deasm-barrier.ll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lit/deasm-barrier.ll b/test/lit/deasm-barrier.ll index 5cbe04e3..82f26625 100644 --- a/test/lit/deasm-barrier.ll +++ b/test/lit/deasm-barrier.ll @@ -2,7 +2,7 @@ ; __asm__ __volatile__ ("" ::: "memory") ; Which can be replaced with C11 'atomic_signal_fence(memory_order_acq_rel)' ; In LLVM IR that becomes (at least in my sample program) -; 'fence singlethread acq_rel' +; 'fence syncscope("singlethread") acq_rel' ; https://en.wikipedia.org/wiki/Memory_ordering#Compile-time_memory_barrier_implementation ; http://en.cppreference.com/w/c/atomic/atomic_signal_fence @@ -15,7 +15,7 @@ ; RUN: allopt -analyze -i %t llvm-dis |& FileCheck %s ; CHECK-NOT: call {{.*}} asm -; CHECK: fence singlethread acq_rel +; CHECK: fence syncscope("singlethread") acq_rel ; CHECK-NOT: call {{.*}} asm ; ModuleID = 'barrier.c' From 7185c8502e656befdc38283f727d14fba6370038 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 19 Sep 2017 13:22:22 -0500 Subject: [PATCH 05/34] StaticCodeGen: formatting, whoops --- libs/StaticCodeGen/StaticCodeGen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 11ef245a..9f9c3bb6 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -71,18 +71,18 @@ static inline void setFunctionAttributes(StringRef CPU, StringRef Features, AttrBuilder NewAttrs; if (!CPU.empty()) - NewAttrs.addAttribute( "target-cpu", CPU); + NewAttrs.addAttribute("target-cpu", CPU); if (!Features.empty()) NewAttrs.addAttribute("target-features", Features); if (DisableFPElim.hasValue()) NewAttrs.addAttribute("no-frame-pointer-elim", - DisableFPElim.getValue() ? "true" : "false"); + DisableFPElim.getValue() ? "true" : "false"); if (DisableTailCalls.hasValue()) NewAttrs.addAttribute("disable-tail-calls", - toStringRef(DisableTailCalls.getValue())); + toStringRef(DisableTailCalls.getValue())); if (StackRealign) NewAttrs.addAttribute("stackrealign"); From 1dc9a572f8337bf38b36b29123a6533a9b96d4d0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 19 Oct 2017 14:26:01 -0500 Subject: [PATCH 06/34] Fix API usage: don't terminate varargs with nullptr --- tools/allmux/CtorUtils.cpp | 2 +- tools/allmux/allmux.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/allmux/CtorUtils.cpp b/tools/allmux/CtorUtils.cpp index d0fe41e2..a6805cf1 100644 --- a/tools/allmux/CtorUtils.cpp +++ b/tools/allmux/CtorUtils.cpp @@ -103,7 +103,7 @@ Function *allvm::createCtorDtorFunc(ArrayRef Fns, Module &M, // just create the function as whatever and then call setName() or something? auto NameS = Name.str(); auto *F = cast( - M.getOrInsertFunction(NameS, Builder.getVoidTy(), nullptr)); + M.getOrInsertFunction(NameS, Builder.getVoidTy())); Builder.SetInsertPoint(BasicBlock::Create(C, "entry", F)); diff --git a/tools/allmux/allmux.cpp b/tools/allmux/allmux.cpp index a1396e25..efd6662b 100644 --- a/tools/allmux/allmux.cpp +++ b/tools/allmux/allmux.cpp @@ -155,7 +155,7 @@ Expected> genMain(ArrayRef Es, LLVMContext &C, assert(AtExit); auto getCtorDtorFn = [&](auto FName) { - return MuxMain->getOrInsertFunction(FName, Builder.getVoidTy(), nullptr); + return MuxMain->getOrInsertFunction(FName, Builder.getVoidTy()); }; auto callCtor = [&](auto FName) { Builder.CreateCall(getCtorDtorFn(FName)); From 35656fc610849abbfa5936beee84549f5be7b383 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 19 Oct 2017 15:37:41 -0500 Subject: [PATCH 07/34] lit: Set XDG_CACHE_HOME to accomodate changed behavior Not really sure /why/ but user_cache_directory is now returning "successfully" but seems to think HOME is "/", which doesn't seem right AFAICT. nix build users have home of /var/empty and HOME=/homeless-shelter... --- test/lit.site.cfg.in | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index 5e2f445c..bdd1b90b 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -17,6 +17,7 @@ curpath = os.environ.get('PATH', '') if curpath: newpath += ":" + curpath config.environment['PATH'] = newpath +config.environment['XDG_CACHE_HOME'] = config.test_exec_root + "/cache"; # TODO: Get this more reliably/directly: " = @LIBNONE_PATH@" or something libnone = "@LLVM_LIBRARY_OUTPUT_INTDIR@/libnone.a" From cd54eb7d54759d25e78144c42b4db33efaca7e0f Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 23 Oct 2017 14:49:55 -0500 Subject: [PATCH 08/34] allmux/*: formatting --- tools/allmux/CtorUtils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/allmux/CtorUtils.cpp b/tools/allmux/CtorUtils.cpp index a6805cf1..56411b52 100644 --- a/tools/allmux/CtorUtils.cpp +++ b/tools/allmux/CtorUtils.cpp @@ -102,8 +102,7 @@ Function *allvm::createCtorDtorFunc(ArrayRef Fns, Module &M, // TODO: Better handle case where function with this name already exists; // just create the function as whatever and then call setName() or something? auto NameS = Name.str(); - auto *F = cast( - M.getOrInsertFunction(NameS, Builder.getVoidTy())); + auto *F = cast(M.getOrInsertFunction(NameS, Builder.getVoidTy())); Builder.SetInsertPoint(BasicBlock::Create(C, "entry", F)); From cab2a161b328859f0cfbecdfdb5b69d3e9687879 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 20 Feb 2018 18:41:05 -0600 Subject: [PATCH 09/34] StaticCodeGen: avoid using stdio on non-x86_64 --- libs/StaticCodeGen/StaticCodeGen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 9f9c3bb6..8e77d123 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -268,7 +268,11 @@ std::string CompilationOptions::serializeCompilationOptions() const { // Serialize OLvl buffer += std::to_string(OLvl); // Serialize TargetOptions +#ifdef __x86_64__ errs() << "Using incomplete serialization of compilation options, FIXME!\n"; +#else +#warning "Unable to emit runtime warning that serialization of compilation options is incomplete!" +#endif buffer += std::to_string(TOptions.PrintMachineCode); // buffer += std::to_string(TOptions.LessPreciseFPMADOption); buffer += std::to_string(TOptions.UnsafeFPMath); From 8c392c03b9f5bc4744b555ee63d29016c6bb5600 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 14:11:57 -0600 Subject: [PATCH 10/34] default to clang5 build on llvm5 branch --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 9990bd74..6d656284 100644 --- a/default.nix +++ b/default.nix @@ -3,5 +3,5 @@ let release = import ./nix/release.nix args; in { - allvm-tools = release.musl.allvm-tools-clang4; + allvm-tools = release.musl.allvm-tools-clang5; } From ddd535065ca1fd8a6939e6fcd83ca9680a84e119 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 15:48:09 -0600 Subject: [PATCH 11/34] update-format $ nix-shell ./format.nix -A update --- libs/StaticCodeGen/StaticCodeGen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 8e77d123..175393a1 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -267,11 +267,12 @@ std::string CompilationOptions::serializeCompilationOptions() const { } // Serialize OLvl buffer += std::to_string(OLvl); - // Serialize TargetOptions +// Serialize TargetOptions #ifdef __x86_64__ errs() << "Using incomplete serialization of compilation options, FIXME!\n"; #else -#warning "Unable to emit runtime warning that serialization of compilation options is incomplete!" +#warning \ + "Unable to emit runtime warning that serialization of compilation options is incomplete!" #endif buffer += std::to_string(TOptions.PrintMachineCode); // buffer += std::to_string(TOptions.LessPreciseFPMADOption); From a65c0234630405009739b0babb200840120ef619 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 15:49:10 -0600 Subject: [PATCH 12/34] StaticCodeGen: move comment to avoid silly placement --- libs/StaticCodeGen/StaticCodeGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 175393a1..ad20ab99 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -267,13 +267,13 @@ std::string CompilationOptions::serializeCompilationOptions() const { } // Serialize OLvl buffer += std::to_string(OLvl); -// Serialize TargetOptions #ifdef __x86_64__ errs() << "Using incomplete serialization of compilation options, FIXME!\n"; #else #warning \ "Unable to emit runtime warning that serialization of compilation options is incomplete!" #endif + // Serialize TargetOptions buffer += std::to_string(TOptions.PrintMachineCode); // buffer += std::to_string(TOptions.LessPreciseFPMADOption); buffer += std::to_string(TOptions.UnsafeFPMath); From a11ca833ad7baffb44ebe092fd6cda8acf3fc462 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 15:54:08 -0600 Subject: [PATCH 13/34] overlay: use llvm_5, lost in rebased merge --- nix/overlay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/overlay.nix b/nix/overlay.nix index 2f10b3b0..335bb415 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,6 +1,6 @@ self: super: rec { allvm-tools = super.callPackage ./build.nix { - inherit (self.llvmPackages_4) llvm clang lld; + inherit (self.llvmPackages_5) llvm clang lld; }; allvm-tools-variants = super.recurseIntoAttrs { From 66c6c31c73f6e3fac3c7af71f0de50c6bdb04a56 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 15:55:44 -0600 Subject: [PATCH 14/34] update-format --- libs/all/Allexe.cpp | 2 +- tools/wllvm-extract/wllvm-extract.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/all/Allexe.cpp b/libs/all/Allexe.cpp index 98aa63c7..43632351 100644 --- a/libs/all/Allexe.cpp +++ b/libs/all/Allexe.cpp @@ -25,7 +25,7 @@ static std::unique_ptr moduleToBuffer(const Module *M) { false, // ShouldPreserveUseListOrder nullptr, // ModuleSummaryIndex (ThinLTO) true // Generate Hash - ); + ); return MemoryBuffer::getMemBufferCopy(OS.str()); } diff --git a/tools/wllvm-extract/wllvm-extract.cpp b/tools/wllvm-extract/wllvm-extract.cpp index 44e93df4..65d01a2e 100644 --- a/tools/wllvm-extract/wllvm-extract.cpp +++ b/tools/wllvm-extract/wllvm-extract.cpp @@ -109,7 +109,7 @@ static Error writeAsSingleBC(const WLLVMFile &File, StringRef Filename) { false, // ShouldPreserveUseListOrder nullptr, // ModuleSummaryIndex (ThinLTO) true // Generate Hash - ); + ); // We made it this far without error, keep the result. Out->keep(); return Error::success(); From 39a07fd7e9916752de40cc4a04bece95457327d3 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 30 Jan 2018 21:10:49 -0600 Subject: [PATCH 15/34] llvm6: use keyword syntax for target_link_libraries, fix build --- tools/all-info/CMakeLists.txt | 2 +- tools/alld/CMakeLists.txt | 2 +- tools/alley/CMakeLists.txt | 1 + tools/allmux/CMakeLists.txt | 2 +- tools/allopt/CMakeLists.txt | 2 +- tools/allready/CMakeLists.txt | 2 +- tools/alltogether/CMakeLists.txt | 2 +- tools/bc2allvm/CMakeLists.txt | 2 +- tools/wllvm-dump/CMakeLists.txt | 2 +- tools/wllvm-extract/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/all-info/CMakeLists.txt b/tools/all-info/CMakeLists.txt index 2396f782..c535b260 100644 --- a/tools/all-info/CMakeLists.txt +++ b/tools/all-info/CMakeLists.txt @@ -6,6 +6,6 @@ add_llvm_tool(all-info all-info.cpp ) -target_link_libraries(all-info liball ResourcePaths) +target_link_libraries(all-info PRIVATE liball ResourcePaths) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/alld/CMakeLists.txt b/tools/alld/CMakeLists.txt index 21b7dd12..154b053e 100644 --- a/tools/alld/CMakeLists.txt +++ b/tools/alld/CMakeLists.txt @@ -2,7 +2,7 @@ add_llvm_tool(alld alld.cpp ) -target_link_libraries(alld ResourcePaths lldELF lldConfig lldCore) +target_link_libraries(alld PRIVATE ResourcePaths lldELF lldConfig lldCore) llvm_config(alld # These are taken directly from lld/ELF/CMakeLists.txt: diff --git a/tools/alley/CMakeLists.txt b/tools/alley/CMakeLists.txt index e4d63f73..bf891e2e 100644 --- a/tools/alley/CMakeLists.txt +++ b/tools/alley/CMakeLists.txt @@ -16,6 +16,7 @@ add_llvm_tool(alley alley.cpp ) target_link_libraries(alley + PRIVATE liball AOTCompile Cache diff --git a/tools/allmux/CMakeLists.txt b/tools/allmux/CMakeLists.txt index a899c0c1..ced01d35 100644 --- a/tools/allmux/CMakeLists.txt +++ b/tools/allmux/CMakeLists.txt @@ -10,7 +10,7 @@ add_llvm_tool(allmux allmux.cpp CtorUtils.cpp ) -target_link_libraries(allmux liball Passes ResourcePaths) +target_link_libraries(allmux PRIVATE liball Passes ResourcePaths) set(MM_BC ${CMAKE_CURRENT_SOURCE_DIR}/main/mux_main.bc) install(FILES ${MM_BC} DESTINATION lib) diff --git a/tools/allopt/CMakeLists.txt b/tools/allopt/CMakeLists.txt index 74211d4b..30d70937 100644 --- a/tools/allopt/CMakeLists.txt +++ b/tools/allopt/CMakeLists.txt @@ -9,6 +9,6 @@ add_llvm_tool(allopt allopt.cpp ) -target_link_libraries(allopt liball ResourcePaths) +target_link_libraries(allopt PRIVATE liball ResourcePaths) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/allready/CMakeLists.txt b/tools/allready/CMakeLists.txt index c502fbbe..c3a75eb5 100644 --- a/tools/allready/CMakeLists.txt +++ b/tools/allready/CMakeLists.txt @@ -16,6 +16,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(allready allready.cpp ) -target_link_libraries(allready liball AOTCompile Cache ExecutionYengine ResourcePaths) +target_link_libraries(allready PRIVATE liball AOTCompile Cache ExecutionYengine ResourcePaths) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/alltogether/CMakeLists.txt b/tools/alltogether/CMakeLists.txt index 2486be34..476f1b04 100644 --- a/tools/alltogether/CMakeLists.txt +++ b/tools/alltogether/CMakeLists.txt @@ -11,6 +11,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(alltogether alltogether.cpp ) -target_link_libraries(alltogether liball ResourcePaths) +target_link_libraries(alltogether PRIVATE liball ResourcePaths) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/bc2allvm/CMakeLists.txt b/tools/bc2allvm/CMakeLists.txt index a5e2239a..c3c78453 100644 --- a/tools/bc2allvm/CMakeLists.txt +++ b/tools/bc2allvm/CMakeLists.txt @@ -8,6 +8,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(bc2allvm bc2allvm.cpp ) -target_link_libraries(bc2allvm liball Passes ResourcePaths) +target_link_libraries(bc2allvm PRIVATE liball Passes ResourcePaths) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/wllvm-dump/CMakeLists.txt b/tools/wllvm-dump/CMakeLists.txt index 8f5ff9df..a439099c 100644 --- a/tools/wllvm-dump/CMakeLists.txt +++ b/tools/wllvm-dump/CMakeLists.txt @@ -10,6 +10,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(wllvm-dump wllvm-dump.cpp ) -target_link_libraries(wllvm-dump wllvm) +target_link_libraries(wllvm-dump PRIVATE wllvm) add_definitions(${LLVM_DEFINITIONS}) diff --git a/tools/wllvm-extract/CMakeLists.txt b/tools/wllvm-extract/CMakeLists.txt index f13b97a5..5f8561ba 100644 --- a/tools/wllvm-extract/CMakeLists.txt +++ b/tools/wllvm-extract/CMakeLists.txt @@ -11,6 +11,6 @@ set(LLVM_LINK_COMPONENTS add_llvm_tool(wllvm-extract wllvm-extract.cpp ) -target_link_libraries(wllvm-extract liball ResourcePaths wllvm Passes) +target_link_libraries(wllvm-extract PRIVATE liball ResourcePaths wllvm Passes) add_definitions(${LLVM_DEFINITIONS}) From f2168984d3ebad1d77aaffec8b05b759587aa9fa Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 06:37:19 -0600 Subject: [PATCH 16/34] ZipArchive: WritableMemoryBuffer (LLVM 6 API update) --- libs/archive-rw/ZipArchive.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/archive-rw/ZipArchive.cpp b/libs/archive-rw/ZipArchive.cpp index 53108e11..a131807a 100644 --- a/libs/archive-rw/ZipArchive.cpp +++ b/libs/archive-rw/ZipArchive.cpp @@ -56,7 +56,7 @@ std::unique_ptr ZipArchive::getEntry(size_t index, zip_stat_t statinfo; zip_stat_index(archive, index, 0, &statinfo); std::unique_ptr buf = - MemoryBuffer::getNewUninitMemBuffer(statinfo.size, files[index]); + WritableMemoryBuffer::getNewUninitMemBuffer(statinfo.size, files[index]); // Decompress the file into the buffer. zip_file_t *fd = zip_fopen_index(archive, index, 0); From 25f182b8d967b796485e12521f3b719d9db06ab7 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 06:52:21 -0600 Subject: [PATCH 17/34] StaticCodeGen: DiagnosticHandler, ToolOutputFile (LLVM6-ify) --- libs/StaticCodeGen/StaticCodeGen.cpp | 40 ++++++++++++++++------------ 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index ad20ab99..9298d56f 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -189,20 +189,25 @@ static Error compileModule(std::unique_ptr &M, raw_pwrite_stream &OS, return Error::success(); } -static void DiagnosticHandler(const DiagnosticInfo &DI, void *Context) { - bool *HasError = static_cast(Context); - if (DI.getSeverity() == DS_Error) - *HasError = true; - - if (auto *Remark = dyn_cast(&DI)) - if (!Remark->isEnabled()) - return; - - DiagnosticPrinterRawOStream DP(errs()); - errs() << LLVMContext::getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; - DI.print(DP); - errs() << "\n"; -} + +struct LLCDiagnosticHandler : public DiagnosticHandler { + bool *HasError; + LLCDiagnosticHandler(bool *HasErrorPtr) : HasError(HasErrorPtr) {} + bool handleDiagnostics(const DiagnosticInfo &DI) override { + if (DI.getSeverity() == DS_Error) + *HasError = true; + + if (auto *Remark = dyn_cast(&DI)) + if (!Remark->isEnabled()) + return true; + + DiagnosticPrinterRawOStream DP(errs()); + errs() << LLVMContext::getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; + DI.print(DP); + errs() << "\n"; + return true; + } +}; namespace allvm { @@ -213,7 +218,8 @@ Error compileAllexe(Allexe &Input, raw_pwrite_stream &OS, // Set a diagnostic handler that doesn't exit on the first error. bool HasError = false; - Context.setDiagnosticHandler(DiagnosticHandler, &HasError); + Context.setDiagnosticHandler( + llvm::make_unique(&HasError)); // Get module to be compiled. auto ExpM = Input.getModule(0, Context); @@ -229,7 +235,7 @@ Error compileAllexe(Allexe &Input, raw_pwrite_stream &OS, // Initialize compilation flags to the llc default values. CompilationOptions::CompilationOptions() - : CMModel(CodeModel::Default), RelocModel(None), OLvl(CodeGenOpt::Default), + : CMModel(CodeModel::Small), RelocModel(None), OLvl(CodeGenOpt::Default), NoVerify(false), DisableSimplifyLibCalls(false), DisableFPElim(None), DisableTailCalls(None), StackRealign(false), TrapFuncName(None) { @@ -353,7 +359,7 @@ compileAllexe(Allexe &Input, StringRef Filename, // Open the output file. std::error_code EC; sys::fs::OpenFlags OpenFlags = sys::fs::F_None; - auto FDOut = llvm::make_unique(Filename, EC, OpenFlags); + auto FDOut = llvm::make_unique(Filename, EC, OpenFlags); if (EC) { return makeStaticCodeGenError("error opening compilation output", EC); } From 34ae3198b91fead7a090b0738d7ee603de640606 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 06:54:40 -0600 Subject: [PATCH 18/34] fixup all tool_output_file refs (LLVM6-ify) --- tools/allopt/allopt.cpp | 2 +- tools/wllvm-extract/wllvm-extract.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/allopt/allopt.cpp b/tools/allopt/allopt.cpp index f2df039e..44f4f125 100644 --- a/tools/allopt/allopt.cpp +++ b/tools/allopt/allopt.cpp @@ -155,7 +155,7 @@ int main(int argc, const char *argv[]) { outs().write(OutData->getBufferStart(), OutData->getBufferSize()); } } else { - tool_output_file out(OutputFilename, EC, sys::fs::F_None); + ToolOutputFile out(OutputFilename, EC, sys::fs::F_None); ExitOnErr(errorCodeToError(EC)); auto OutData = ExitOnErr(errorOrToExpected(MemoryBuffer::getFile(TempOut))); diff --git a/tools/wllvm-extract/wllvm-extract.cpp b/tools/wllvm-extract/wllvm-extract.cpp index 65d01a2e..b23021d3 100644 --- a/tools/wllvm-extract/wllvm-extract.cpp +++ b/tools/wllvm-extract/wllvm-extract.cpp @@ -86,9 +86,9 @@ static std::string getDefaultSuffix(OutputKind K) { static Error writeAsSingleBC(const WLLVMFile &File, StringRef Filename) { // Initialize output file, error early if unavailable - std::unique_ptr Out; + std::unique_ptr Out; std::error_code EC; - Out.reset(new tool_output_file(Filename, EC, sys::fs::F_None)); + Out.reset(new ToolOutputFile(Filename, EC, sys::fs::F_None)); if (EC) return make_error( "error opening output file '" + Filename + "'", EC); From 09e1acecb390de6b50f2abe2856e18fcccd4cf3b Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 06:56:26 -0600 Subject: [PATCH 19/34] ALLVMLinker: redirects (LLVM6-ify) --- libs/StaticCodeGen/ALLVMLinker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/StaticCodeGen/ALLVMLinker.cpp b/libs/StaticCodeGen/ALLVMLinker.cpp index ec9057f5..a1b44b98 100644 --- a/libs/StaticCodeGen/ALLVMLinker.cpp +++ b/libs/StaticCodeGen/ALLVMLinker.cpp @@ -46,7 +46,7 @@ Error ALLVMLinker::callLinkerAsExternalProcess(StringRef LinkerProgram, bool ExecutionFailed; std::string ErrorMsg; int Res = llvm::sys::ExecuteAndWait(LinkerProgram, LinkerArgv, - /*env*/ nullptr, /*Redirects*/ nullptr, + /*env*/ nullptr, /*Redirects*/ {}, /*secondsToWait*/ 0, /*memoryLimit*/ 0, &ErrorMsg, &ExecutionFailed); From 783c942f8550df2f50246990d2fdabbb3561b347 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:00:46 -0600 Subject: [PATCH 20/34] alld: includes, linking (LLVM6-ify) --- tools/alld/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/alld/CMakeLists.txt b/tools/alld/CMakeLists.txt index 154b053e..a73c4320 100644 --- a/tools/alld/CMakeLists.txt +++ b/tools/alld/CMakeLists.txt @@ -2,7 +2,7 @@ add_llvm_tool(alld alld.cpp ) -target_link_libraries(alld PRIVATE ResourcePaths lldELF lldConfig lldCore) +target_link_libraries(alld PRIVATE ResourcePaths lldELF lldCommon) llvm_config(alld # These are taken directly from lld/ELF/CMakeLists.txt: From f7d2050f0e44d7495d41ddf48376c62df1b7bba2 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:04:20 -0600 Subject: [PATCH 21/34] alley: don't include CommandFlags.h ? (LLVM6-ify) It's now CommandFlags.def, need to revisit why it was included anyway. --- tools/alley/alley.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/alley/alley.cpp b/tools/alley/alley.cpp index a08529dd..adcc51ae 100644 --- a/tools/alley/alley.cpp +++ b/tools/alley/alley.cpp @@ -6,7 +6,8 @@ #include "allvm/ResourceAnchor.h" #include "allvm/ToolCommon.h" -#include +// XXX: Revisit this +//#include #include #include #include From b6f345736b69cbd01a11b2174b7cc3d7cdf03ac0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:07:54 -0600 Subject: [PATCH 22/34] allopt: redirects are Optional now (LLVM6-ify) --- tools/allopt/allopt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/allopt/allopt.cpp b/tools/allopt/allopt.cpp index 44f4f125..2c718160 100644 --- a/tools/allopt/allopt.cpp +++ b/tools/allopt/allopt.cpp @@ -60,7 +60,7 @@ Error runPipeline(StringRef Input, StringRef Output) { // Empty environment const char *env[] = {nullptr}; - const StringRef *redirects[] = {&Input, &Output, nullptr}; + Optional redirects[3] = {Input, Output, None}; // XXX: Make these cl::opt's? unsigned secondsToWait = 0; From bb82241e5efefdcb0db71536c6fde6c8cb21d13d Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:09:11 -0600 Subject: [PATCH 23/34] allready: drop CommandFlags.h include (LLVM6-ify) --- tools/allready/allready.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/allready/allready.cpp b/tools/allready/allready.cpp index 064a5e50..92f8ac26 100644 --- a/tools/allready/allready.cpp +++ b/tools/allready/allready.cpp @@ -16,7 +16,8 @@ #include "allvm/ResourceAnchor.h" #include "allvm/ToolCommon.h" -#include +// XXX: Revisit this! +//#include #include #include #include From 78e026cc9466028366b8d665f8ec08bbec783275 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:10:08 -0600 Subject: [PATCH 24/34] alltogether: include CommandFlags.def (LLVM6-ify) --- tools/alltogether/alltogether.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/alltogether/alltogether.cpp b/tools/alltogether/alltogether.cpp index 640f8403..52c72c16 100644 --- a/tools/alltogether/alltogether.cpp +++ b/tools/alltogether/alltogether.cpp @@ -14,8 +14,10 @@ #include "allvm/ResourceAnchor.h" #include "allvm/ToolCommon.h" +// XXX: Revisit this! +#include + #include -#include #include #include #include From 896befeda7a188066a241dc76c2bdebcd55890b4 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:12:07 -0600 Subject: [PATCH 25/34] wllvm-extract: writeArchive returns Error now (LLVM6-ify) --- tools/wllvm-extract/wllvm-extract.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/wllvm-extract/wllvm-extract.cpp b/tools/wllvm-extract/wllvm-extract.cpp index b23021d3..9197cac6 100644 --- a/tools/wllvm-extract/wllvm-extract.cpp +++ b/tools/wllvm-extract/wllvm-extract.cpp @@ -136,13 +136,10 @@ static Error writeAsBitcodeArchive(const WLLVMFile &File, StringRef Filename) { Twine(unique_id++) + "-" + sys::path::filename(BCFilename)); Members.push_back(std::move(*Member)); } - auto result = + return writeArchive(Filename, Members, true /* writeSymTab */, Archive::K_GNU, true /* deterministic */, false /* thin */); - if (result.second) - return make_error(result.first, result.second); - return Error::success(); } static Error writeAsAllexe(const WLLVMFile &File, StringRef Filename, From a556039165502474830023027679b902eb4951d7 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:25:39 -0600 Subject: [PATCH 26/34] test: fixup llvm-lit discovery, just always use local (LLVM6-ify) --- test/CMakeLists.txt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e62cd3c9..ab6a1fdb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,14 +26,7 @@ set(ALLVM_TEST_PARAMS set(LIT_REPORT ${CMAKE_CURRENT_BINARY_DIR}/report.xml) set(ALLVM_TEST_EXTRA_ARGS --no-progress-bar -v --xunit-xml-output=${LIT_REPORT}) -# try to find 'lit' -find_program(LIT_COMMAND llvm-lit) -if (EXISTS ${LLVM_INSTALL_PREFIX}/lit/lit.py) - set(LIT_COMMAND ${LLVM_INSTALL_PREFIX}/lit/lit.py) -endif() -if (NOT LIT_COMMAND) - set(LIT_COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/third_party/lit/lit.py) -endif() +set(LLVM_EXTERNAL_LIT ${CMAKE_SOURCE_DIR}/third_party/lit/lit.py) # Check we have FileCheck utility, as indicator of the LLVM utilities. find_program(FILECHECK_PATH FileCheck HINTS ${LLVM_TOOLS_BINARY_DIR}) @@ -56,5 +49,3 @@ add_lit_testsuites(ALLVM ${CMAKE_CURRENT_SOURCE_DIR} PARAMS ${ALLVM_TEST_PARAMS} DEPENDS ${ALLVM_TEST_DEPENDS} ) - -message(STATUS "Using lit command: ${LIT_COMMAND}") From a32ec25da7300f69417a596f69fcf5dba375ba33 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 07:51:11 -0600 Subject: [PATCH 27/34] StaticCodeGen: fix breakage in diagnosticHandler usage (LLVM6-ify) --- libs/StaticCodeGen/StaticCodeGen.cpp | 47 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index 9298d56f..b9a69361 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -28,6 +28,27 @@ using namespace allvm; using namespace llvm; using namespace object; +namespace { +struct LLCDiagnosticHandler : public DiagnosticHandler { + bool *HasError; + LLCDiagnosticHandler(bool *HasErrorPtr) : HasError(HasErrorPtr) {} + bool handleDiagnostics(const DiagnosticInfo &DI) override { + if (DI.getSeverity() == DS_Error) + *HasError = true; + + if (auto *Remark = dyn_cast(&DI)) + if (!Remark->isEnabled()) + return true; + + DiagnosticPrinterRawOStream DP(errs()); + errs() << LLVMContext::getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; + DI.print(DP); + errs() << "\n"; + return true; + } +}; +} // end anonymous namespace + static inline std::string getCPUStr(StringRef MCPU) { // If user asked for the 'native' CPU, autodetect here. If autodection fails, // this will set the CPU to an empty string which tells the target to @@ -180,35 +201,15 @@ static Error compileModule(std::unique_ptr &M, raw_pwrite_stream &OS, // Run passes to do compilation. PM.run(*M); - auto HasError = *static_cast(Context.getDiagnosticContext()); - // TODO: Produce better error message? - if (HasError) { + auto HasError = + ((const LLCDiagnosticHandler *)(Context.getDiagHandlerPtr()))->HasError; + if (*HasError) return makeStaticCodeGenError("unknown error compiling to object file"); - } return Error::success(); } -struct LLCDiagnosticHandler : public DiagnosticHandler { - bool *HasError; - LLCDiagnosticHandler(bool *HasErrorPtr) : HasError(HasErrorPtr) {} - bool handleDiagnostics(const DiagnosticInfo &DI) override { - if (DI.getSeverity() == DS_Error) - *HasError = true; - - if (auto *Remark = dyn_cast(&DI)) - if (!Remark->isEnabled()) - return true; - - DiagnosticPrinterRawOStream DP(errs()); - errs() << LLVMContext::getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; - DI.print(DP); - errs() << "\n"; - return true; - } -}; - namespace allvm { Error compileAllexe(Allexe &Input, raw_pwrite_stream &OS, From a56bff0f881df924c0b6fc87ad4d015645c819c3 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Wed, 31 Jan 2018 08:31:33 -0600 Subject: [PATCH 28/34] update-format --- libs/StaticCodeGen/StaticCodeGen.cpp | 3 +-- tools/wllvm-extract/wllvm-extract.cpp | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index b9a69361..7204bc04 100644 --- a/libs/StaticCodeGen/StaticCodeGen.cpp +++ b/libs/StaticCodeGen/StaticCodeGen.cpp @@ -202,14 +202,13 @@ static Error compileModule(std::unique_ptr &M, raw_pwrite_stream &OS, PM.run(*M); auto HasError = - ((const LLCDiagnosticHandler *)(Context.getDiagHandlerPtr()))->HasError; + ((const LLCDiagnosticHandler *)(Context.getDiagHandlerPtr()))->HasError; if (*HasError) return makeStaticCodeGenError("unknown error compiling to object file"); return Error::success(); } - namespace allvm { Error compileAllexe(Allexe &Input, raw_pwrite_stream &OS, diff --git a/tools/wllvm-extract/wllvm-extract.cpp b/tools/wllvm-extract/wllvm-extract.cpp index 9197cac6..243d6706 100644 --- a/tools/wllvm-extract/wllvm-extract.cpp +++ b/tools/wllvm-extract/wllvm-extract.cpp @@ -136,10 +136,8 @@ static Error writeAsBitcodeArchive(const WLLVMFile &File, StringRef Filename) { Twine(unique_id++) + "-" + sys::path::filename(BCFilename)); Members.push_back(std::move(*Member)); } - return - writeArchive(Filename, Members, true /* writeSymTab */, Archive::K_GNU, - true /* deterministic */, false /* thin */); - + return writeArchive(Filename, Members, true /* writeSymTab */, Archive::K_GNU, + true /* deterministic */, false /* thin */); } static Error writeAsAllexe(const WLLVMFile &File, StringRef Filename, From 5f3cdd4e1e51865a3c46904448d3d223d6a6983f Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 20 Feb 2018 11:46:21 -0600 Subject: [PATCH 29/34] ToolCommon: capture var instead of static, now that API lets us Previously version printer was a raw function pointer, and as such we couldn't capture anything in our lambda, hence the 'static' kludge. LLVM 6 now takes std::function here (and passes the OS as an argument), so take advantage of this for a minor cleanup. --- include/allvm/ToolCommon.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/allvm/ToolCommon.h b/include/allvm/ToolCommon.h index 972d81b6..ad5f1a1d 100644 --- a/include/allvm/ToolCommon.h +++ b/include/allvm/ToolCommon.h @@ -20,10 +20,8 @@ class ALLVMTool { llvm::cl::OptionCategory ALLVMOptCat{CatName}; auto getVersionPrinter() { - static std::string CapturedName = Name; - return []() { - llvm::raw_ostream &OS = llvm::outs(); - OS << CapturedName << " (ALLVM Tools) " << allvm::getALLVMVersion() + return [Name = this->Name](auto &OS) { + OS << Name << " (ALLVM Tools) " << allvm::getALLVMVersion() << "\n"; OS << " ALLVM Project (http://allvm.org)\n"; OS << " LLVM version " << LLVM_VERSION_STRING << "\n"; From 82b6330aaa473776e9dcb03c60f6c0e2183dcdaa Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 20 Feb 2018 12:08:12 -0600 Subject: [PATCH 30/34] update-format --- include/allvm/ToolCommon.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/allvm/ToolCommon.h b/include/allvm/ToolCommon.h index ad5f1a1d..aa049a33 100644 --- a/include/allvm/ToolCommon.h +++ b/include/allvm/ToolCommon.h @@ -21,8 +21,7 @@ class ALLVMTool { auto getVersionPrinter() { return [Name = this->Name](auto &OS) { - OS << Name << " (ALLVM Tools) " << allvm::getALLVMVersion() - << "\n"; + OS << Name << " (ALLVM Tools) " << allvm::getALLVMVersion() << "\n"; OS << " ALLVM Project (http://allvm.org)\n"; OS << " LLVM version " << LLVM_VERSION_STRING << "\n"; @@ -42,7 +41,6 @@ class ALLVMTool { OS << ".\n" << " Default target: " << llvm::sys::getDefaultTargetTriple() << '\n' << " Host CPU: " << CPU << '\n'; - }; } From 09c9fc680b293d94b9c28d444529919c7906482b Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 20 Feb 2018 12:23:57 -0600 Subject: [PATCH 31/34] set version printer later on llvm6 --- include/allvm/ToolCommon.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/allvm/ToolCommon.h b/include/allvm/ToolCommon.h index aa049a33..1c196d11 100644 --- a/include/allvm/ToolCommon.h +++ b/include/allvm/ToolCommon.h @@ -46,12 +46,11 @@ class ALLVMTool { public: ALLVMTool(llvm::StringRef _Name, llvm::StringRef _Overview = "") - : Name(_Name), Overview(_Overview) { - llvm::cl::SetVersionPrinter(getVersionPrinter()); - } + : Name(_Name), Overview(_Overview) {} bool parseCLOpts(int argc, const char *const *argv) { llvm::cl::HideUnrelatedOptions(ALLVMOptCat); + llvm::cl::SetVersionPrinter(getVersionPrinter()); return llvm::cl::ParseCommandLineOptions(argc, argv, Overview); } From 6d2553b96d27811ac83acc65d31ae33e8f1697d5 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 14:09:20 -0600 Subject: [PATCH 32/34] overlay: whoops, llvm6 --- nix/overlay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/overlay.nix b/nix/overlay.nix index 335bb415..e09c5725 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,6 +1,6 @@ self: super: rec { allvm-tools = super.callPackage ./build.nix { - inherit (self.llvmPackages_5) llvm clang lld; + inherit (self.llvmPackages_6) llvm clang lld; }; allvm-tools-variants = super.recurseIntoAttrs { From 447c022249b2ab4578b059a301108973be4ff850 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 15:52:19 -0600 Subject: [PATCH 33/34] default.nix: use clang6 by default --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 6d656284..7c9f9097 100644 --- a/default.nix +++ b/default.nix @@ -3,5 +3,5 @@ let release = import ./nix/release.nix args; in { - allvm-tools = release.musl.allvm-tools-clang5; + allvm-tools = release.musl.allvm-tools-clang6; } From 7ba546a30a4977540c0962b76b988abd0695a6f8 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 26 Feb 2018 17:19:55 -0600 Subject: [PATCH 34/34] alld: fix include missed during rebase --- tools/alld/alld.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/alld/alld.cpp b/tools/alld/alld.cpp index 52de871f..fbc7ad49 100644 --- a/tools/alld/alld.cpp +++ b/tools/alld/alld.cpp @@ -7,7 +7,7 @@ // Linker wrapper for lld. // //===----------------------------------------------------------------------===// -#include +#include #include #include