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; } 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; diff --git a/libs/StaticCodeGen/StaticCodeGen.cpp b/libs/StaticCodeGen/StaticCodeGen.cpp index d0817863..ad20ab99 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", - DisableFPElim.getValue() ? "true" : "false"); + NewAttrs.addAttribute("no-frame-pointer-elim", + DisableFPElim.getValue() ? "true" : "false"); if (DisableTailCalls.hasValue()) - NewAttrs = NewAttrs.addAttribute( - Ctx, AttributeSet::FunctionIndex, "disable-tail-calls", - toStringRef(DisableTailCalls.getValue())); + 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)); } } @@ -271,9 +267,15 @@ std::string CompilationOptions::serializeCompilationOptions() const { } // Serialize OLvl buffer += std::to_string(OLvl); +#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.LessPreciseFPMADOption); buffer += std::to_string(TOptions.UnsafeFPMath); buffer += std::to_string(TOptions.NoInfsFPMath); buffer += std::to_string(TOptions.NoNaNsFPMath); @@ -286,7 +288,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); 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/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 { 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" 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' diff --git a/tools/allmux/CtorUtils.cpp b/tools/allmux/CtorUtils.cpp index d0fe41e2..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(), nullptr)); + auto *F = cast(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)); 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();