diff options
| author | Rui Ueyama <ruiu@google.com> | 2013-10-09 00:57:22 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2013-10-09 00:57:22 +0000 |
| commit | c6015f6476530d25dc8fbe7cb5fa4668312a69ac (patch) | |
| tree | ebb668e4052c5dccd2bee1449e7b54669a64c2d5 /lld/lib/ReaderWriter | |
| parent | 1c1b443997f22b63164effd41fbfb7f7c34c8a51 (diff) | |
| download | bcm5719-llvm-c6015f6476530d25dc8fbe7cb5fa4668312a69ac.tar.gz bcm5719-llvm-c6015f6476530d25dc8fbe7cb5fa4668312a69ac.zip | |
Update error classes from all lowercase to camel case.
llvm-svn: 192261
Diffstat (limited to 'lld/lib/ReaderWriter')
11 files changed, 47 insertions, 47 deletions
diff --git a/lld/lib/ReaderWriter/CoreLinkingContext.cpp b/lld/lib/ReaderWriter/CoreLinkingContext.cpp index db17d57d43e..ec8962bbce2 100644 --- a/lld/lib/ReaderWriter/CoreLinkingContext.cpp +++ b/lld/lib/ReaderWriter/CoreLinkingContext.cpp @@ -298,7 +298,7 @@ CoreLinkingContext::relocKindFromString(StringRef str) const { if (str.equals(p->string)) return p->value; } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } ErrorOr<std::string> @@ -307,5 +307,5 @@ CoreLinkingContext::stringFromRelocKind(Reference::Kind kind) const { if (kind == p->value) return std::string(p->string); } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp index 74bb83faac6..ddca2b28f0e 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp @@ -147,7 +147,7 @@ elf::HexagonLinkingContext::relocKindFromString(StringRef str) const { LLD_CASE(R_HEX_TPREL_16_X) LLD_CASE(R_HEX_TPREL_11_X).Default(-1); if (ret == -1) - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); return ret; } @@ -248,5 +248,5 @@ elf::HexagonLinkingContext::stringFromRelocKind(int32_t kind) const { LLD_CASE(R_HEX_TPREL_11_X) } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } diff --git a/lld/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp index e6e2c5df7d9..0b397eaa26a 100644 --- a/lld/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp @@ -15,7 +15,7 @@ elf::PPCLinkingContext::relocKindFromString(StringRef str) const { LLD_CASE(R_PPC_ADDR32).Default(-1); if (ret == -1) - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); return ret; } @@ -32,5 +32,5 @@ elf::PPCLinkingContext::stringFromRelocKind(Reference::Kind kind) const { LLD_CASE(R_PPC_ADDR32) } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } diff --git a/lld/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp b/lld/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp index 4700cf80f08..236f8e19223 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp @@ -15,7 +15,7 @@ elf::X86LinkingContext::relocKindFromString(StringRef str) const { LLD_CASE(R_386_PC32).Default(-1); if (ret == -1) - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); return ret; } @@ -32,5 +32,5 @@ elf::X86LinkingContext::stringFromRelocKind(Reference::Kind kind) const { LLD_CASE(R_386_PC32) } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp index beb7fb83bd2..5be3d5ea6ca 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp @@ -567,7 +567,7 @@ elf::X86_64LinkingContext::relocKindFromString(StringRef str) const { .Default(-1); if (ret == -1) - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); return ret; } @@ -622,6 +622,6 @@ elf::X86_64LinkingContext::stringFromRelocKind(Reference::Kind kind) const { return std::string("LLD_R_X86_64_GOTRELINDEX"); } - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 3aead42f422..b799b797250 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -622,7 +622,7 @@ readYaml(std::unique_ptr<MemoryBuffer> &mb) { // Return error if there were parsing problems. if (yin.error()) - return make_error_code(lld::yaml_reader_error::illegal_value); + return make_error_code(lld::YamlReaderError::illegal_value); // Hand ownership of instantiated NormalizedFile to caller. return std::move(f); diff --git a/lld/lib/ReaderWriter/Native/ReaderNative.cpp b/lld/lib/ReaderWriter/Native/ReaderNative.cpp index 2ee3b80ac62..be80dc98c08 100644 --- a/lld/lib/ReaderWriter/Native/ReaderNative.cpp +++ b/lld/lib/ReaderWriter/Native/ReaderNative.cpp @@ -261,12 +261,12 @@ public: reinterpret_cast<const NativeChunk *>(base + sizeof(NativeFileHeader)); // make sure magic matches if ( memcmp(header->magic, NATIVE_FILE_HEADER_MAGIC, 16) != 0 ) - return make_error_code(native_reader_error::unknown_file_format); + return make_error_code(NativeReaderError::unknown_file_format); // make sure mapped file contains all needed data const size_t fileSize = mb->getBufferSize(); if (header->fileSize > fileSize) - return make_error_code(native_reader_error::file_too_short); + return make_error_code(NativeReaderError::file_too_short); DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs() << " Native File Header:" << " fileSize=" @@ -282,9 +282,9 @@ public: const NativeChunk* chunk = &chunks[i]; // sanity check chunk is within file if ( chunk->fileOffset > fileSize ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); if ( (chunk->fileOffset + chunk->fileSize) > fileSize) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); // process chunk, based on signature switch ( chunk->signature ) { case NCS_DefinedAtomsV1: @@ -321,7 +321,7 @@ public: ec = file->processStrings(base, chunk); break; default: - return make_error_code(native_reader_error::unknown_chunk_type); + return make_error_code(NativeReaderError::unknown_chunk_type); } if ( ec ) { return ec; @@ -349,7 +349,7 @@ public: } result.push_back(std::move(file)); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } virtual ~File() { @@ -396,11 +396,11 @@ private: uint8_t* atomsStart = reinterpret_cast<uint8_t*> (operator new(atomsArraySize, std::nothrow)); if (atomsStart == nullptr) - return make_error_code(native_reader_error::memory_error); + return make_error_code(NativeReaderError::memory_error); const size_t ivarElementSize = chunk->fileSize / chunk->elementCount; if ( ivarElementSize != sizeof(NativeDefinedAtomIvarsV1) ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); uint8_t* atomsEnd = atomsStart + atomsArraySize; const NativeDefinedAtomIvarsV1* ivarData = reinterpret_cast<const NativeDefinedAtomIvarsV1*> @@ -420,7 +420,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } @@ -435,7 +435,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } // set up pointers to attributes array @@ -448,7 +448,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } // instantiate array of UndefinedAtoms from v1 ivar data in file @@ -459,11 +459,11 @@ private: uint8_t* atomsStart = reinterpret_cast<uint8_t*> (operator new(atomsArraySize, std::nothrow)); if (atomsStart == nullptr) - return make_error_code(native_reader_error::memory_error); + return make_error_code(NativeReaderError::memory_error); const size_t ivarElementSize = chunk->fileSize / chunk->elementCount; if ( ivarElementSize != sizeof(NativeUndefinedAtomIvarsV1) ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); uint8_t* atomsEnd = atomsStart + atomsArraySize; const NativeUndefinedAtomIvarsV1* ivarData = reinterpret_cast<const NativeUndefinedAtomIvarsV1*> @@ -483,7 +483,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } @@ -495,11 +495,11 @@ private: uint8_t* atomsStart = reinterpret_cast<uint8_t*> (operator new(atomsArraySize, std::nothrow)); if (atomsStart == nullptr) - return make_error_code(native_reader_error::memory_error); + return make_error_code(NativeReaderError::memory_error); const size_t ivarElementSize = chunk->fileSize / chunk->elementCount; if ( ivarElementSize != sizeof(NativeSharedLibraryAtomIvarsV1) ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); uint8_t* atomsEnd = atomsStart + atomsArraySize; const NativeSharedLibraryAtomIvarsV1* ivarData = reinterpret_cast<const NativeSharedLibraryAtomIvarsV1*> @@ -519,7 +519,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } @@ -531,11 +531,11 @@ private: uint8_t* atomsStart = reinterpret_cast<uint8_t*> (operator new(atomsArraySize, std::nothrow)); if (atomsStart == nullptr) - return make_error_code(native_reader_error::memory_error); + return make_error_code(NativeReaderError::memory_error); const size_t ivarElementSize = chunk->fileSize / chunk->elementCount; if ( ivarElementSize != sizeof(NativeAbsoluteAtomIvarsV1) ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); uint8_t* atomsEnd = atomsStart + atomsArraySize; const NativeAbsoluteAtomIvarsV1* ivarData = reinterpret_cast<const NativeAbsoluteAtomIvarsV1*> @@ -555,7 +555,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } @@ -565,17 +565,17 @@ private: error_code processReferencesV1(const uint8_t *base, const NativeChunk *chunk) { if ( chunk->elementCount == 0 ) - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); const size_t refSize = sizeof(NativeReferenceV1); size_t refsArraySize = chunk->elementCount * refSize; uint8_t* refsStart = reinterpret_cast<uint8_t*> (operator new(refsArraySize, std::nothrow)); if (refsStart == nullptr) - return make_error_code(native_reader_error::memory_error); + return make_error_code(NativeReaderError::memory_error); const size_t ivarElementSize = chunk->fileSize / chunk->elementCount; if ( ivarElementSize != sizeof(NativeReferenceIvarsV1) ) - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); uint8_t* refsEnd = refsStart + refsArraySize; const NativeReferenceIvarsV1* ivarData = reinterpret_cast<const NativeReferenceIvarsV1*> @@ -595,7 +595,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } // set up pointers to target table @@ -637,14 +637,14 @@ private: this->_targetsTable[i] = reinterpret_cast<const AbsoluteAtom*>(p); continue; } - return make_error_code(native_reader_error::file_malformed); + return make_error_code(NativeReaderError::file_malformed); } DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs() << " chunk Targets Table: " << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } @@ -659,7 +659,7 @@ private: << " count=" << chunk->elementCount << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } // set up pointers to string pool in file @@ -671,7 +671,7 @@ private: << " chunk Strings: " << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } // set up pointers to content area in file @@ -683,7 +683,7 @@ private: << " chunk content: " << " chunkSize=" << chunk->fileSize << "\n"); - return make_error_code(native_reader_error::success); + return make_error_code(NativeReaderError::success); } StringRef string(uint32_t offset) const { diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp index ccb5b375482..22edee732d5 100644 --- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp +++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp @@ -121,12 +121,12 @@ Writer &PECOFFLinkingContext::writer() const { return *_writer; } ErrorOr<Reference::Kind> PECOFFLinkingContext::relocKindFromString(StringRef str) const { - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } ErrorOr<std::string> PECOFFLinkingContext::stringFromRelocKind(Reference::Kind kind) const { - return make_error_code(yaml_reader_error::illegal_value); + return make_error_code(YamlReaderError::illegal_value); } void PECOFFLinkingContext::addPasses(PassManager &pm) const { diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp index 29d2c133a3d..483a137582c 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp @@ -194,7 +194,7 @@ public: // Check if the total size is valid. if (end - buf != sizeof(COFF::ImportHeader) + dataSize) { - ec = make_error_code(native_reader_error::unknown_file_format); + ec = make_error_code(NativeReaderError::unknown_file_format); return; } @@ -312,7 +312,7 @@ error_code parseCOFFImportLibrary(const LinkingContext &targetInfo, // Error if the file is too small or does not start with the magic. if (end - buf < static_cast<ptrdiff_t>(sizeof(COFF::ImportHeader)) || memcmp(buf, "\0\0\xFF\xFF", 4)) - return make_error_code(native_reader_error::unknown_file_format); + return make_error_code(NativeReaderError::unknown_file_format); error_code ec; auto file = std::unique_ptr<File>( diff --git a/lld/lib/ReaderWriter/ReaderLinkerScript.cpp b/lld/lib/ReaderWriter/ReaderLinkerScript.cpp index 0a18f96b00d..902cc5f5ef2 100644 --- a/lld/lib/ReaderWriter/ReaderLinkerScript.cpp +++ b/lld/lib/ReaderWriter/ReaderLinkerScript.cpp @@ -26,7 +26,7 @@ public: new LinkerScriptFile(context, std::move(mb))); file->_script = file->_parser.parse(); if (!file->_script) - return linker_script_reader_error::parse_error; + return LinkerScriptReaderError::parse_error; return std::move(file); } diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index 7ad662c60ad..142cbfe888e 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -1284,14 +1284,14 @@ public: // Quit now if there were parsing errors. if (yin.error()) - return make_error_code(lld::yaml_reader_error::illegal_value); + return make_error_code(lld::YamlReaderError::illegal_value); for (const File *file : createdFiles) { // Note: parseFile() should return vector of *const* File File *f = const_cast<File *>(file); result.emplace_back(f); } - return make_error_code(lld::yaml_reader_error::success); + return make_error_code(lld::YamlReaderError::success); } }; } // end namespace yaml |

