diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/ExecutionEngine | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/ExecutionEngine')
13 files changed, 94 insertions, 94 deletions
diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp index c8bbf0bcdf..2352e8734d 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/ExecutionEngine.cpp @@ -471,7 +471,7 @@ EngineBuilder::EngineBuilder() : EngineBuilder(nullptr) {} EngineBuilder::EngineBuilder(std::unique_ptr<Module> M) : M(std::move(M)), WhichEngine(EngineKind::Either), ErrorStr(nullptr), - OptLevel(CodeGenOpt::Default), MemMgr(nullptr), Resolver(nullptr) { + OptLevel(CodeGenOpt::Default), MemMgr(nullptr), Resolver(nullptr) { // IR module verification is enabled by default in debug builds, and disabled // by default in release builds. #ifndef NDEBUG @@ -534,7 +534,7 @@ ExecutionEngine *EngineBuilder::create(TargetMachine *TM) { } ExecutionEngine *EE = nullptr; - if (ExecutionEngine::MCJITCtor) + if (ExecutionEngine::MCJITCtor) EE = ExecutionEngine::MCJITCtor(std::move(M), ErrorStr, std::move(MemMgr), std::move(Resolver), std::move(TheTM)); diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/MCJIT.h b/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/MCJIT.h index 52e7eda903..d737e78437 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/MCJIT.h +++ b/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/MCJIT.h @@ -102,22 +102,22 @@ class MCJIT : public ExecutionEngine { } bool hasModuleBeenAddedButNotLoaded(Module *M) { - return AddedModules.contains(M); + return AddedModules.contains(M); } bool hasModuleBeenLoaded(Module *M) { // If the module is in either the "loaded" or "finalized" sections it // has been loaded. - return LoadedModules.contains(M) || FinalizedModules.contains(M); + return LoadedModules.contains(M) || FinalizedModules.contains(M); } bool hasModuleBeenFinalized(Module *M) { - return FinalizedModules.contains(M); + return FinalizedModules.contains(M); } bool ownsModule(Module* M) { - return AddedModules.contains(M) || LoadedModules.contains(M) || - FinalizedModules.contains(M); + return AddedModules.contains(M) || LoadedModules.contains(M) || + FinalizedModules.contains(M); } void markModuleAsLoaded(Module *M) { diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/ya.make b/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/ya.make index 71377b654c..05253d65e8 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/ya.make +++ b/contrib/libs/llvm12/lib/ExecutionEngine/MCJIT/ya.make @@ -12,14 +12,14 @@ LICENSE(Apache-2.0 WITH LLVM-exception) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/libs/llvm12 - contrib/libs/llvm12/include - contrib/libs/llvm12/lib/ExecutionEngine - contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld - contrib/libs/llvm12/lib/IR - contrib/libs/llvm12/lib/Object - contrib/libs/llvm12/lib/Support - contrib/libs/llvm12/lib/Target + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/ExecutionEngine + contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld + contrib/libs/llvm12/lib/IR + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Support + contrib/libs/llvm12/lib/Target ) ADDINCL( diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/ya.make b/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/ya.make index dc91e6b801..3c266bef99 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/ya.make +++ b/contrib/libs/llvm12/lib/ExecutionEngine/PerfJITEvents/ya.make @@ -12,14 +12,14 @@ LICENSE(Apache-2.0 WITH LLVM-exception) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/libs/llvm12 - contrib/libs/llvm12/lib/CodeGen - contrib/libs/llvm12/lib/DebugInfo/DWARF - contrib/libs/llvm12/lib/ExecutionEngine - contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld - contrib/libs/llvm12/lib/IR - contrib/libs/llvm12/lib/Object - contrib/libs/llvm12/lib/Support + contrib/libs/llvm12 + contrib/libs/llvm12/lib/CodeGen + contrib/libs/llvm12/lib/DebugInfo/DWARF + contrib/libs/llvm12/lib/ExecutionEngine + contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld + contrib/libs/llvm12/lib/IR + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Support ) ADDINCL( diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp index 741aa58350..136f7a5d74 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp @@ -31,8 +31,8 @@ namespace llvm { RTDyldMemoryManager::~RTDyldMemoryManager() {} -#if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \ - !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) +#if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \ + !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) extern "C" void __register_frame(void *); extern "C" void __deregister_frame(void *); #else diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index e49e6e541f..b5c64db21f 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -1206,19 +1206,19 @@ Error RuntimeDyldImpl::resolveExternalSymbols() { void RuntimeDyldImpl::finalizeAsync( std::unique_ptr<RuntimeDyldImpl> This, - unique_function<void(object::OwningBinary<object::ObjectFile>, - std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, Error)> + unique_function<void(object::OwningBinary<object::ObjectFile>, + std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, Error)> OnEmitted, - object::OwningBinary<object::ObjectFile> O, - std::unique_ptr<RuntimeDyld::LoadedObjectInfo> Info) { + object::OwningBinary<object::ObjectFile> O, + std::unique_ptr<RuntimeDyld::LoadedObjectInfo> Info) { auto SharedThis = std::shared_ptr<RuntimeDyldImpl>(std::move(This)); auto PostResolveContinuation = - [SharedThis, OnEmitted = std::move(OnEmitted), O = std::move(O), - Info = std::move(Info)]( + [SharedThis, OnEmitted = std::move(OnEmitted), O = std::move(O), + Info = std::move(Info)]( Expected<JITSymbolResolver::LookupResult> Result) mutable { if (!Result) { - OnEmitted(std::move(O), std::move(Info), Result.takeError()); + OnEmitted(std::move(O), std::move(Info), Result.takeError()); return; } @@ -1232,11 +1232,11 @@ void RuntimeDyldImpl::finalizeAsync( SharedThis->registerEHFrames(); std::string ErrMsg; if (SharedThis->MemMgr.finalizeMemory(&ErrMsg)) - OnEmitted(std::move(O), std::move(Info), + OnEmitted(std::move(O), std::move(Info), make_error<StringError>(std::move(ErrMsg), inconvertibleErrorCode())); else - OnEmitted(std::move(O), std::move(Info), Error::success()); + OnEmitted(std::move(O), std::move(Info), Error::success()); }; JITSymbolResolver::LookupSet Symbols; @@ -1428,12 +1428,12 @@ void jitLinkForORC( object::OwningBinary<object::ObjectFile> O, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, bool ProcessAllSections, - unique_function<Error(const object::ObjectFile &Obj, - RuntimeDyld::LoadedObjectInfo &LoadedObj, - std::map<StringRef, JITEvaluatedSymbol>)> + unique_function<Error(const object::ObjectFile &Obj, + RuntimeDyld::LoadedObjectInfo &LoadedObj, + std::map<StringRef, JITEvaluatedSymbol>)> OnLoaded, - unique_function<void(object::OwningBinary<object::ObjectFile>, - std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, Error)> + unique_function<void(object::OwningBinary<object::ObjectFile>, + std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, Error)> OnEmitted) { RuntimeDyld RTDyld(MemMgr, Resolver); @@ -1442,17 +1442,17 @@ void jitLinkForORC( auto Info = RTDyld.loadObject(*O.getBinary()); if (RTDyld.hasError()) { - OnEmitted(std::move(O), std::move(Info), - make_error<StringError>(RTDyld.getErrorString(), - inconvertibleErrorCode())); + OnEmitted(std::move(O), std::move(Info), + make_error<StringError>(RTDyld.getErrorString(), + inconvertibleErrorCode())); return; } - if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable())) - OnEmitted(std::move(O), std::move(Info), std::move(Err)); + if (auto Err = OnLoaded(*O.getBinary(), *Info, RTDyld.getSymbolTable())) + OnEmitted(std::move(O), std::move(Info), std::move(Err)); RuntimeDyldImpl::finalizeAsync(std::move(RTDyld.Dyld), std::move(OnEmitted), - std::move(O), std::move(Info)); + std::move(O), std::move(Info)); } } // end namespace llvm diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 2fbe707ce8..31d8109bf7 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -352,7 +352,7 @@ private: RemainingExpr = RemainingExpr.substr(1).ltrim(); uint64_t StubAddr; - std::string ErrorMsg; + std::string ErrorMsg; std::tie(StubAddr, ErrorMsg) = Checker.getStubOrGOTAddrFor( StubContainerName, Symbol, PCtx.IsInsideLoad, IsStubAddr); @@ -389,7 +389,7 @@ private: RemainingExpr = RemainingExpr.substr(1).ltrim(); uint64_t StubAddr; - std::string ErrorMsg; + std::string ErrorMsg; std::tie(StubAddr, ErrorMsg) = Checker.getSectionAddr( FileName, SectionName, PCtx.IsInsideLoad); diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index 28e1faab5a..03e62bf025 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -954,8 +954,8 @@ void RuntimeDyldELF::resolveRelocation(const SectionEntry &Section, resolveARMRelocation(Section, Offset, (uint32_t)(Value & 0xffffffffL), Type, (uint32_t)(Addend & 0xffffffffL)); break; - case Triple::ppc: // Fall through. - case Triple::ppcle: + case Triple::ppc: // Fall through. + case Triple::ppcle: resolvePPC32Relocation(Section, Offset, Value, Type, Addend); break; case Triple::ppc64: // Fall through. @@ -1670,33 +1670,33 @@ RuntimeDyldELF::processRelocationRef( if (Value.SymbolName) { // This is a call to an external function. // Look for an existing stub. - SectionEntry *Section = &Sections[SectionID]; + SectionEntry *Section = &Sections[SectionID]; StubMap::const_iterator i = Stubs.find(Value); uintptr_t StubAddress; if (i != Stubs.end()) { - StubAddress = uintptr_t(Section->getAddress()) + i->second; + StubAddress = uintptr_t(Section->getAddress()) + i->second; LLVM_DEBUG(dbgs() << " Stub function found\n"); } else { // Create a new stub function (equivalent to a PLT entry). LLVM_DEBUG(dbgs() << " Create a new stub function\n"); - uintptr_t BaseAddress = uintptr_t(Section->getAddress()); + uintptr_t BaseAddress = uintptr_t(Section->getAddress()); uintptr_t StubAlignment = getStubAlignment(); StubAddress = - (BaseAddress + Section->getStubOffset() + StubAlignment - 1) & + (BaseAddress + Section->getStubOffset() + StubAlignment - 1) & -StubAlignment; unsigned StubOffset = StubAddress - BaseAddress; Stubs[Value] = StubOffset; createStubFunction((uint8_t *)StubAddress); // Bump our stub offset counter - Section->advanceStubOffset(getMaxStubSize()); + Section->advanceStubOffset(getMaxStubSize()); // Allocate a GOT Entry uint64_t GOTOffset = allocateGOTEntries(1); - // This potentially creates a new Section which potentially - // invalidates the Section pointer, so reload it. - Section = &Sections[SectionID]; + // This potentially creates a new Section which potentially + // invalidates the Section pointer, so reload it. + Section = &Sections[SectionID]; // The load of the GOT address has an addend of -4 resolveGOTOffsetRelocation(SectionID, StubOffset + 2, GOTOffset - 4, @@ -1709,7 +1709,7 @@ RuntimeDyldELF::processRelocationRef( } // Make the target call a call into the stub table. - resolveRelocation(*Section, Offset, StubAddress, ELF::R_X86_64_PC32, + resolveRelocation(*Section, Offset, StubAddress, ELF::R_X86_64_PC32, Addend); } else { RelocationEntry RE(SectionID, Offset, ELF::R_X86_64_PC32, Value.Addend, diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index d34fae9aaf..49e3dbc7fe 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -535,12 +535,12 @@ public: static void finalizeAsync( std::unique_ptr<RuntimeDyldImpl> This, - unique_function<void(object::OwningBinary<object::ObjectFile>, - std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, - Error)> + unique_function<void(object::OwningBinary<object::ObjectFile>, + std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, + Error)> OnEmitted, - object::OwningBinary<object::ObjectFile> O, - std::unique_ptr<RuntimeDyld::LoadedObjectInfo> Info); + object::OwningBinary<object::ObjectFile> O, + std::unique_ptr<RuntimeDyld::LoadedObjectInfo> Info); void reassignSectionAddress(unsigned SectionID, uint64_t Addr); diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h index 9df3e2e3c3..f600432e0b 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h @@ -113,10 +113,10 @@ public: // The MemoryManager can make sure this is always true by forcing the // memory layout to be: CodeSection < ReadOnlySection < ReadWriteSection. const uint64_t ImageBase = getImageBase(); - if (Value < ImageBase || ((Value - ImageBase) > UINT32_MAX)) - report_fatal_error("IMAGE_REL_AMD64_ADDR32NB relocation requires an " - "ordered section layout"); - else { + if (Value < ImageBase || ((Value - ImageBase) > UINT32_MAX)) + report_fatal_error("IMAGE_REL_AMD64_ADDR32NB relocation requires an " + "ordered section layout"); + else { write32BitOffset(Target, RE.Addend, Value - ImageBase); } break; diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/ya.make b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/ya.make index 44d7dea118..68dac33fc3 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/ya.make +++ b/contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld/ya.make @@ -12,12 +12,12 @@ LICENSE(Apache-2.0 WITH LLVM-exception) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/libs/llvm12 - contrib/libs/llvm12/include - contrib/libs/llvm12/lib/IR - contrib/libs/llvm12/lib/MC - contrib/libs/llvm12/lib/Object - contrib/libs/llvm12/lib/Support + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/IR + contrib/libs/llvm12/lib/MC + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Support ) ADDINCL( diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp b/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp index 6690dd07d9..ba25ea0839 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp +++ b/contrib/libs/llvm12/lib/ExecutionEngine/SectionMemoryManager.cpp @@ -112,15 +112,15 @@ uint8_t *SectionMemoryManager::allocateSection( // Save this address as the basis for our next request MemGroup.Near = MB; - // Copy the address to all the other groups, if they have not - // been initialized. - if (CodeMem.Near.base() == 0) - CodeMem.Near = MB; - if (RODataMem.Near.base() == 0) - RODataMem.Near = MB; - if (RWDataMem.Near.base() == 0) - RWDataMem.Near = MB; - + // Copy the address to all the other groups, if they have not + // been initialized. + if (CodeMem.Near.base() == 0) + CodeMem.Near = MB; + if (RODataMem.Near.base() == 0) + RODataMem.Near = MB; + if (RWDataMem.Near.base() == 0) + RWDataMem.Near = MB; + // Remember that we allocated this memory MemGroup.AllocatedMem.push_back(MB); Addr = (uintptr_t)MB.base(); @@ -161,7 +161,7 @@ bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg) { } // Make read-only data memory read-only. - ec = applyMemoryGroupPermissions(RODataMem, sys::Memory::MF_READ); + ec = applyMemoryGroupPermissions(RODataMem, sys::Memory::MF_READ); if (ec) { if (ErrMsg) { *ErrMsg = ec.message(); @@ -218,9 +218,9 @@ SectionMemoryManager::applyMemoryGroupPermissions(MemoryGroup &MemGroup, } // Remove all blocks which are now empty - erase_if(MemGroup.FreeMem, [](FreeMemBlock &FreeMB) { - return FreeMB.Free.allocatedSize() == 0; - }); + erase_if(MemGroup.FreeMem, [](FreeMemBlock &FreeMB) { + return FreeMB.Free.allocatedSize() == 0; + }); return std::error_code(); } diff --git a/contrib/libs/llvm12/lib/ExecutionEngine/ya.make b/contrib/libs/llvm12/lib/ExecutionEngine/ya.make index 38849572cb..3eeadb4e79 100644 --- a/contrib/libs/llvm12/lib/ExecutionEngine/ya.make +++ b/contrib/libs/llvm12/lib/ExecutionEngine/ya.make @@ -12,14 +12,14 @@ LICENSE(Apache-2.0 WITH LLVM-exception) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/libs/llvm12 - contrib/libs/llvm12/include - contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld - contrib/libs/llvm12/lib/IR - contrib/libs/llvm12/lib/MC - contrib/libs/llvm12/lib/Object - contrib/libs/llvm12/lib/Support - contrib/libs/llvm12/lib/Target + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/ExecutionEngine/RuntimeDyld + contrib/libs/llvm12/lib/IR + contrib/libs/llvm12/lib/MC + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Support + contrib/libs/llvm12/lib/Target ) ADDINCL( |