summaryrefslogtreecommitdiffstats
path: root/lld/lib
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-10-09 00:57:22 +0000
committerRui Ueyama <ruiu@google.com>2013-10-09 00:57:22 +0000
commitc6015f6476530d25dc8fbe7cb5fa4668312a69ac (patch)
treeebb668e4052c5dccd2bee1449e7b54669a64c2d5 /lld/lib
parent1c1b443997f22b63164effd41fbfb7f7c34c8a51 (diff)
downloadbcm5719-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')
-rw-r--r--lld/lib/Core/Error.cpp66
-rw-r--r--lld/lib/Core/LinkingContext.cpp10
-rw-r--r--lld/lib/Core/Resolver.cpp2
-rw-r--r--lld/lib/Driver/InputGraph.cpp2
-rw-r--r--lld/lib/ReaderWriter/CoreLinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp2
-rw-r--r--lld/lib/ReaderWriter/Native/ReaderNative.cpp58
-rw-r--r--lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp4
-rw-r--r--lld/lib/ReaderWriter/ReaderLinkerScript.cpp2
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp4
15 files changed, 87 insertions, 87 deletions
diff --git a/lld/lib/Core/Error.cpp b/lld/lib/Core/Error.cpp
index 60e49645e34..34c785dc70e 100644
--- a/lld/lib/Core/Error.cpp
+++ b/lld/lib/Core/Error.cpp
@@ -13,117 +13,117 @@
using namespace lld;
-class _native_reader_error_category : public llvm::_do_message {
+class _NativeReaderErrorCategory : public llvm::_do_message {
public:
virtual const char* name() const {
return "lld.native.reader";
}
virtual std::string message(int ev) const {
- if (native_reader_error(ev) == native_reader_error::success)
+ if (NativeReaderError(ev) == NativeReaderError::success)
return "Success";
- if (native_reader_error(ev) == native_reader_error::unknown_file_format)
+ if (NativeReaderError(ev) == NativeReaderError::unknown_file_format)
return "Unknown file format";
- if (native_reader_error(ev) == native_reader_error::file_too_short)
+ if (NativeReaderError(ev) == NativeReaderError::file_too_short)
return "file truncated";
- if (native_reader_error(ev) == native_reader_error::file_malformed)
+ if (NativeReaderError(ev) == NativeReaderError::file_malformed)
return "file malformed";
- if (native_reader_error(ev) == native_reader_error::memory_error)
+ if (NativeReaderError(ev) == NativeReaderError::memory_error)
return "out of memory";
- if (native_reader_error(ev) == native_reader_error::unknown_chunk_type)
+ if (NativeReaderError(ev) == NativeReaderError::unknown_chunk_type)
return "unknown chunk type";
- llvm_unreachable("An enumerator of native_reader_error does not have a "
+ llvm_unreachable("An enumerator of NativeReaderError does not have a "
"message defined.");
}
virtual llvm::error_condition default_error_condition(int ev) const {
- if (native_reader_error(ev) == native_reader_error::success)
+ if (NativeReaderError(ev) == NativeReaderError::success)
return llvm::errc::success;
return llvm::errc::invalid_argument;
}
};
const llvm::error_category &lld::native_reader_category() {
- static _native_reader_error_category o;
+ static _NativeReaderErrorCategory o;
return o;
}
-class _yaml_reader_error_category : public llvm::_do_message {
+class _YamlReaderErrorCategory : public llvm::_do_message {
public:
virtual const char* name() const {
return "lld.yaml.reader";
}
virtual std::string message(int ev) const {
- if (yaml_reader_error(ev) == yaml_reader_error::success)
+ if (YamlReaderError(ev) == YamlReaderError::success)
return "Success";
- if (yaml_reader_error(ev) == yaml_reader_error::unknown_keyword)
+ if (YamlReaderError(ev) == YamlReaderError::unknown_keyword)
return "Unknown keyword found in yaml file";
- if (yaml_reader_error(ev) == yaml_reader_error::illegal_value)
+ if (YamlReaderError(ev) == YamlReaderError::illegal_value)
return "Bad value found in yaml file";
- llvm_unreachable("An enumerator of yaml_reader_error does not have a "
+ llvm_unreachable("An enumerator of YamlReaderError does not have a "
"message defined.");
}
virtual llvm::error_condition default_error_condition(int ev) const {
- if (yaml_reader_error(ev) == yaml_reader_error::success)
+ if (YamlReaderError(ev) == YamlReaderError::success)
return llvm::errc::success;
return llvm::errc::invalid_argument;
}
};
-const llvm::error_category &lld::yaml_reader_category() {
- static _yaml_reader_error_category o;
+const llvm::error_category &lld::YamlReaderCategory() {
+ static _YamlReaderErrorCategory o;
return o;
}
-class _linker_script_reader_error_category : public llvm::_do_message {
+class _LinkerScriptReaderErrorCategory : public llvm::_do_message {
public:
virtual const char *name() const { return "lld.linker-script.reader"; }
virtual std::string message(int ev) const {
- linker_script_reader_error e = linker_script_reader_error(ev);
- if (e == linker_script_reader_error::success)
+ LinkerScriptReaderError e = LinkerScriptReaderError(ev);
+ if (e == LinkerScriptReaderError::success)
return "Success";
- if (e == linker_script_reader_error::parse_error)
+ if (e == LinkerScriptReaderError::parse_error)
return "Error parsing linker script";
llvm_unreachable(
- "An enumerator of linker_script_reader_error does not have a "
+ "An enumerator of LinkerScriptReaderError does not have a "
"message defined.");
}
virtual llvm::error_condition default_error_condition(int ev) const {
- linker_script_reader_error e = linker_script_reader_error(ev);
- if (e == linker_script_reader_error::success)
+ LinkerScriptReaderError e = LinkerScriptReaderError(ev);
+ if (e == LinkerScriptReaderError::success)
return llvm::errc::success;
return llvm::errc::invalid_argument;
}
};
-const llvm::error_category &lld::linker_script_reader_category() {
- static _linker_script_reader_error_category o;
+const llvm::error_category &lld::LinkerScriptReaderCategory() {
+ static _LinkerScriptReaderErrorCategory o;
return o;
}
-class _input_graph_error_category : public llvm::_do_message {
+class _InputGraphErrorCategory : public llvm::_do_message {
public:
virtual const char *name() const { return "lld.inputGraph.parse"; }
virtual std::string message(int ev) const {
- if (input_graph_error(ev) == input_graph_error::success)
+ if (InputGraphError(ev) == InputGraphError::success)
return "Success";
- llvm_unreachable("An enumerator of input_graph_error does not have a "
+ llvm_unreachable("An enumerator of InputGraphError does not have a "
"message defined.");
}
virtual llvm::error_condition default_error_condition(int ev) const {
- if (input_graph_error(ev) == input_graph_error::success)
+ if (InputGraphError(ev) == InputGraphError::success)
return llvm::errc::success;
return llvm::errc::invalid_argument;
}
};
-const llvm::error_category &lld::input_graph_error_category() {
- static _input_graph_error_category i;
+const llvm::error_category &lld::InputGraphErrorCategory() {
+ static _InputGraphErrorCategory i;
return i;
}
diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp
index 22a9ccf6e05..31dfed40437 100644
--- a/lld/lib/Core/LinkingContext.cpp
+++ b/lld/lib/Core/LinkingContext.cpp
@@ -85,8 +85,8 @@ ErrorOr<File &> LinkingContext::nextFile() {
// initialized. Initialize it with the first element of the input graph.
if (_currentInputElement == nullptr) {
ErrorOr<InputElement *> elem = inputGraph().getNextInputElement();
- if (error_code(elem) == input_graph_error::no_more_elements)
- return make_error_code(input_graph_error::no_more_files);
+ if (error_code(elem) == InputGraphError::no_more_elements)
+ return make_error_code(InputGraphError::no_more_files);
_currentInputElement = *elem;
}
@@ -96,13 +96,13 @@ ErrorOr<File &> LinkingContext::nextFile() {
// graph.
for (;;) {
ErrorOr<File &> nextFile = _currentInputElement->getNextFile();
- if (error_code(nextFile) != input_graph_error::no_more_files)
+ if (error_code(nextFile) != InputGraphError::no_more_files)
return std::move(nextFile);
ErrorOr<InputElement *> elem = inputGraph().getNextInputElement();
- if (error_code(elem) == input_graph_error::no_more_elements ||
+ if (error_code(elem) == InputGraphError::no_more_elements ||
*elem == nullptr)
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
_currentInputElement = *elem;
}
}
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp
index db52da9775f..ca383abf326 100644
--- a/lld/lib/Core/Resolver.cpp
+++ b/lld/lib/Core/Resolver.cpp
@@ -292,7 +292,7 @@ void Resolver::resolveUndefines() {
ScopedTask task(getDefaultDomain(), "resolveUndefines");
while (ErrorOr<File &> nextFile = _context.nextFile()) {
- if (error_code(nextFile) == input_graph_error::no_more_files)
+ if (error_code(nextFile) == InputGraphError::no_more_files)
break;
if (nextFile->kind() == File::kindObject)
handleFile(*nextFile);
diff --git a/lld/lib/Driver/InputGraph.cpp b/lld/lib/Driver/InputGraph.cpp
index 2d3e65cc87e..0ff6b4fd1cf 100644
--- a/lld/lib/Driver/InputGraph.cpp
+++ b/lld/lib/Driver/InputGraph.cpp
@@ -77,7 +77,7 @@ void InputGraph::insertOneElementAt(std::unique_ptr<InputElement> element,
/// \brief Helper functions for the resolver
ErrorOr<InputElement *> InputGraph::getNextInputElement() {
if (_nextElementIndex >= _inputArgs.size())
- return make_error_code(input_graph_error::no_more_elements);
+ return make_error_code(InputGraphError::no_more_elements);
return _inputArgs[_nextElementIndex++].get();
}
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
OpenPOWER on IntegriCloud