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/BinaryFormat/XCOFF.cpp | |
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/BinaryFormat/XCOFF.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/BinaryFormat/XCOFF.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/contrib/libs/llvm12/lib/BinaryFormat/XCOFF.cpp b/contrib/libs/llvm12/lib/BinaryFormat/XCOFF.cpp index 253decd197..0f270a5cea 100644 --- a/contrib/libs/llvm12/lib/BinaryFormat/XCOFF.cpp +++ b/contrib/libs/llvm12/lib/BinaryFormat/XCOFF.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/BinaryFormat/XCOFF.h" -#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" using namespace llvm; @@ -76,81 +76,81 @@ StringRef XCOFF::getRelocationTypeString(XCOFF::RelocationType Type) { } return "Unknown"; } - -#define LANG_CASE(A) \ - case XCOFF::TracebackTable::A: \ - return #A; - -StringRef XCOFF::getNameForTracebackTableLanguageId( - XCOFF::TracebackTable::LanguageID LangId) { - switch (LangId) { - LANG_CASE(C) - LANG_CASE(Fortran) - LANG_CASE(Pascal) - LANG_CASE(Ada) - LANG_CASE(PL1) - LANG_CASE(Basic) - LANG_CASE(Lisp) - LANG_CASE(Cobol) - LANG_CASE(Modula2) - LANG_CASE(Rpg) - LANG_CASE(PL8) - LANG_CASE(Assembly) - LANG_CASE(Java) - LANG_CASE(ObjectiveC) - LANG_CASE(CPlusPlus) - } - return "Unknown"; -} -#undef LANG_CASE - -SmallString<32> XCOFF::parseParmsType(uint32_t Value, unsigned ParmsNum) { - SmallString<32> ParmsType; - for (unsigned I = 0; I < ParmsNum; ++I) { - if (I != 0) - ParmsType += ", "; - if ((Value & TracebackTable::ParmTypeIsFloatingBit) == 0) { - // Fixed parameter type. - ParmsType += "i"; - Value <<= 1; - } else { - if ((Value & TracebackTable::ParmTypeFloatingIsDoubleBit) == 0) - // Float parameter type. - ParmsType += "f"; - else - // Double parameter type. - ParmsType += "d"; - - Value <<= 2; - } - } - assert(Value == 0u && "ParmsType encodes more than ParmsNum parameters."); - return ParmsType; -} - -SmallString<32> XCOFF::getExtendedTBTableFlagString(uint8_t Flag) { - SmallString<32> Res; - - if (Flag & ExtendedTBTableFlag::TB_OS1) - Res += "TB_OS1 "; - if (Flag & ExtendedTBTableFlag::TB_RESERVED) - Res += "TB_RESERVED "; - if (Flag & ExtendedTBTableFlag::TB_SSP_CANARY) - Res += "TB_SSP_CANARY "; - if (Flag & ExtendedTBTableFlag::TB_OS2) - Res += "TB_OS2 "; - if (Flag & ExtendedTBTableFlag::TB_EH_INFO) - Res += "TB_EH_INFO "; - if (Flag & ExtendedTBTableFlag::TB_LONGTBTABLE2) - Res += "TB_LONGTBTABLE2 "; - - // Two of the bits that haven't got used in the mask. - if (Flag & 0x06) - Res += "Unknown "; - - // Pop the last space. - Res.pop_back(); - return Res; -} - + +#define LANG_CASE(A) \ + case XCOFF::TracebackTable::A: \ + return #A; + +StringRef XCOFF::getNameForTracebackTableLanguageId( + XCOFF::TracebackTable::LanguageID LangId) { + switch (LangId) { + LANG_CASE(C) + LANG_CASE(Fortran) + LANG_CASE(Pascal) + LANG_CASE(Ada) + LANG_CASE(PL1) + LANG_CASE(Basic) + LANG_CASE(Lisp) + LANG_CASE(Cobol) + LANG_CASE(Modula2) + LANG_CASE(Rpg) + LANG_CASE(PL8) + LANG_CASE(Assembly) + LANG_CASE(Java) + LANG_CASE(ObjectiveC) + LANG_CASE(CPlusPlus) + } + return "Unknown"; +} +#undef LANG_CASE + +SmallString<32> XCOFF::parseParmsType(uint32_t Value, unsigned ParmsNum) { + SmallString<32> ParmsType; + for (unsigned I = 0; I < ParmsNum; ++I) { + if (I != 0) + ParmsType += ", "; + if ((Value & TracebackTable::ParmTypeIsFloatingBit) == 0) { + // Fixed parameter type. + ParmsType += "i"; + Value <<= 1; + } else { + if ((Value & TracebackTable::ParmTypeFloatingIsDoubleBit) == 0) + // Float parameter type. + ParmsType += "f"; + else + // Double parameter type. + ParmsType += "d"; + + Value <<= 2; + } + } + assert(Value == 0u && "ParmsType encodes more than ParmsNum parameters."); + return ParmsType; +} + +SmallString<32> XCOFF::getExtendedTBTableFlagString(uint8_t Flag) { + SmallString<32> Res; + + if (Flag & ExtendedTBTableFlag::TB_OS1) + Res += "TB_OS1 "; + if (Flag & ExtendedTBTableFlag::TB_RESERVED) + Res += "TB_RESERVED "; + if (Flag & ExtendedTBTableFlag::TB_SSP_CANARY) + Res += "TB_SSP_CANARY "; + if (Flag & ExtendedTBTableFlag::TB_OS2) + Res += "TB_OS2 "; + if (Flag & ExtendedTBTableFlag::TB_EH_INFO) + Res += "TB_EH_INFO "; + if (Flag & ExtendedTBTableFlag::TB_LONGTBTABLE2) + Res += "TB_LONGTBTABLE2 "; + + // Two of the bits that haven't got used in the mask. + if (Flag & 0x06) + Res += "Unknown "; + + // Pop the last space. + Res.pop_back(); + return Res; +} + #undef RELOC_CASE |