diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/ToolDrivers | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/ToolDrivers')
3 files changed, 38 insertions, 38 deletions
diff --git a/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool/ya.make b/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool/ya.make index 87b6a373a2..3de52a0add 100644 --- a/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool/ya.make +++ b/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool/ya.make @@ -12,16 +12,16 @@ 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/Object - contrib/libs/llvm12/lib/Option - contrib/libs/llvm12/lib/Support + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Option + contrib/libs/llvm12/lib/Support ) ADDINCL( - ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool - contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool + ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool + contrib/libs/llvm12/lib/ToolDrivers/llvm-dlltool ) NO_COMPILER_WARNINGS() diff --git a/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/LibDriver.cpp index 6a8977ad84..f3904b921e 100644 --- a/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/LibDriver.cpp +++ b/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/LibDriver.cpp @@ -139,28 +139,28 @@ static void doList(opt::InputArgList& Args) { fatalOpenError(std::move(Err), B->getBufferIdentifier()); } -static Expected<COFF::MachineTypes> getCOFFFileMachine(MemoryBufferRef MB) { +static Expected<COFF::MachineTypes> getCOFFFileMachine(MemoryBufferRef MB) { std::error_code EC; auto Obj = object::COFFObjectFile::create(MB); - if (!Obj) - return Obj.takeError(); + if (!Obj) + return Obj.takeError(); uint16_t Machine = (*Obj)->getMachine(); if (Machine != COFF::IMAGE_FILE_MACHINE_I386 && Machine != COFF::IMAGE_FILE_MACHINE_AMD64 && Machine != COFF::IMAGE_FILE_MACHINE_ARMNT && Machine != COFF::IMAGE_FILE_MACHINE_ARM64) { - return createStringError(inconvertibleErrorCode(), - "unknown machine: " + std::to_string(Machine)); + return createStringError(inconvertibleErrorCode(), + "unknown machine: " + std::to_string(Machine)); } return static_cast<COFF::MachineTypes>(Machine); } -static Expected<COFF::MachineTypes> getBitcodeFileMachine(MemoryBufferRef MB) { +static Expected<COFF::MachineTypes> getBitcodeFileMachine(MemoryBufferRef MB) { Expected<std::string> TripleStr = getBitcodeTargetTriple(MB); - if (!TripleStr) - return TripleStr.takeError(); + if (!TripleStr) + return TripleStr.takeError(); switch (Triple(*TripleStr).getArch()) { case Triple::x86: @@ -172,8 +172,8 @@ static Expected<COFF::MachineTypes> getBitcodeFileMachine(MemoryBufferRef MB) { case Triple::aarch64: return COFF::IMAGE_FILE_MACHINE_ARM64; default: - return createStringError(inconvertibleErrorCode(), - "unknown arch in target triple: " + *TripleStr); + return createStringError(inconvertibleErrorCode(), + "unknown arch in target triple: " + *TripleStr); } } @@ -193,7 +193,7 @@ static void appendFile(std::vector<NewArchiveMember> &Members, // If a user attempts to add an archive to another archive, llvm-lib doesn't // handle the first archive file as a single file. Instead, it extracts all - // members from the archive and add them to the second archive. This behavior + // members from the archive and add them to the second archive. This behavior // is for compatibility with Microsoft's lib command. if (Magic == file_magic::archive) { Error Err = Error::success(); @@ -225,17 +225,17 @@ static void appendFile(std::vector<NewArchiveMember> &Members, // in writeArchive() which needs to support many tools, can't assume the // input is COFF, and doesn't have a good way to report errors. if (Magic == file_magic::coff_object || Magic == file_magic::bitcode) { - Expected<COFF::MachineTypes> MaybeFileMachine = - (Magic == file_magic::coff_object) ? getCOFFFileMachine(MB) - : getBitcodeFileMachine(MB); - if (!MaybeFileMachine) { - handleAllErrors(MaybeFileMachine.takeError(), [&](const ErrorInfoBase &EIB) { - llvm::errs() << MB.getBufferIdentifier() << ": " << EIB.message() - << "\n"; - }); - exit(1); - } - COFF::MachineTypes FileMachine = *MaybeFileMachine; + Expected<COFF::MachineTypes> MaybeFileMachine = + (Magic == file_magic::coff_object) ? getCOFFFileMachine(MB) + : getBitcodeFileMachine(MB); + if (!MaybeFileMachine) { + handleAllErrors(MaybeFileMachine.takeError(), [&](const ErrorInfoBase &EIB) { + llvm::errs() << MB.getBufferIdentifier() << ": " << EIB.message() + << "\n"; + }); + exit(1); + } + COFF::MachineTypes FileMachine = *MaybeFileMachine; // FIXME: Once lld-link rejects multiple resource .obj files: // Call convertResToCOFF() on .res files and add the resulting diff --git a/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/ya.make b/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/ya.make index 9ec00a6abd..cbe474770c 100644 --- a/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/ya.make +++ b/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib/ya.make @@ -12,18 +12,18 @@ 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/BinaryFormat - contrib/libs/llvm12/lib/Bitcode/Reader - contrib/libs/llvm12/lib/Object - contrib/libs/llvm12/lib/Option - contrib/libs/llvm12/lib/Support + contrib/libs/llvm12 + contrib/libs/llvm12/include + contrib/libs/llvm12/lib/BinaryFormat + contrib/libs/llvm12/lib/Bitcode/Reader + contrib/libs/llvm12/lib/Object + contrib/libs/llvm12/lib/Option + contrib/libs/llvm12/lib/Support ) ADDINCL( - ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib - contrib/libs/llvm12/lib/ToolDrivers/llvm-lib + ${ARCADIA_BUILD_ROOT}/contrib/libs/llvm12/lib/ToolDrivers/llvm-lib + contrib/libs/llvm12/lib/ToolDrivers/llvm-lib ) NO_COMPILER_WARNINGS() |