[lld] r192261 - Update error classes from all lowercase to camel case.
Rui Ueyama
ruiu at google.com
Tue Oct 8 17:57:23 PDT 2013
Author: ruiu
Date: Tue Oct 8 19:57:22 2013
New Revision: 192261
URL: http://llvm.org/viewvc/llvm-project?rev=192261&view=rev
Log:
Update error classes from all lowercase to camel case.
Modified:
lld/trunk/include/lld/Core/Error.h
lld/trunk/include/lld/Core/LinkingContext.h
lld/trunk/include/lld/Driver/CoreInputGraph.h
lld/trunk/include/lld/Driver/DarwinInputGraph.h
lld/trunk/include/lld/Driver/GnuLdInputGraph.h
lld/trunk/include/lld/Driver/InputGraph.h
lld/trunk/include/lld/Driver/WinLinkInputGraph.h
lld/trunk/lib/Core/Error.cpp
lld/trunk/lib/Core/LinkingContext.cpp
lld/trunk/lib/Core/Resolver.cpp
lld/trunk/lib/Driver/InputGraph.cpp
lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
lld/trunk/lib/ReaderWriter/ReaderLinkerScript.cpp
lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
Modified: lld/trunk/include/lld/Core/Error.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Error.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Error.h (original)
+++ lld/trunk/include/lld/Core/Error.h Tue Oct 8 19:57:22 2013
@@ -20,7 +20,7 @@ namespace lld {
const llvm::error_category &native_reader_category();
-enum class native_reader_error {
+enum class NativeReaderError {
success = 0,
unknown_file_format,
file_too_short,
@@ -29,56 +29,56 @@ enum class native_reader_error {
memory_error,
};
-inline llvm::error_code make_error_code(native_reader_error e) {
+inline llvm::error_code make_error_code(NativeReaderError e) {
return llvm::error_code(static_cast<int>(e), native_reader_category());
}
-const llvm::error_category &yaml_reader_category();
+const llvm::error_category &YamlReaderCategory();
-enum class yaml_reader_error {
+enum class YamlReaderError {
success = 0,
unknown_keyword,
illegal_value
};
-inline llvm::error_code make_error_code(yaml_reader_error e) {
- return llvm::error_code(static_cast<int>(e), yaml_reader_category());
+inline llvm::error_code make_error_code(YamlReaderError e) {
+ return llvm::error_code(static_cast<int>(e), YamlReaderCategory());
}
-const llvm::error_category &linker_script_reader_category();
+const llvm::error_category &LinkerScriptReaderCategory();
-enum class linker_script_reader_error {
+enum class LinkerScriptReaderError {
success = 0,
parse_error
};
-inline llvm::error_code make_error_code(linker_script_reader_error e) {
- return llvm::error_code(static_cast<int>(e), linker_script_reader_category());
+inline llvm::error_code make_error_code(LinkerScriptReaderError e) {
+ return llvm::error_code(static_cast<int>(e), LinkerScriptReaderCategory());
}
/// \brief Errors returned by InputGraph functionality
-const llvm::error_category &input_graph_error_category();
+const llvm::error_category &InputGraphErrorCategory();
-enum class input_graph_error {
+enum class InputGraphError {
success = 0,
failure = 1,
no_more_elements,
no_more_files
};
-inline llvm::error_code make_error_code(input_graph_error e) {
- return llvm::error_code(static_cast<int>(e), input_graph_error_category());
+inline llvm::error_code make_error_code(InputGraphError e) {
+ return llvm::error_code(static_cast<int>(e), InputGraphErrorCategory());
}
} // end namespace lld
namespace llvm {
-template <> struct is_error_code_enum<lld::native_reader_error> : true_type {};
-template <> struct is_error_code_enum<lld::yaml_reader_error> : true_type {};
+template <> struct is_error_code_enum<lld::NativeReaderError> : true_type {};
+template <> struct is_error_code_enum<lld::YamlReaderError> : true_type {};
template <>
-struct is_error_code_enum<lld::linker_script_reader_error> : true_type {};
-template <> struct is_error_code_enum<lld::input_graph_error> : true_type {};
+struct is_error_code_enum<lld::LinkerScriptReaderError> : true_type {};
+template <> struct is_error_code_enum<lld::InputGraphError> : true_type {};
} // end namespace llvm
#endif
Modified: lld/trunk/include/lld/Core/LinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/LinkingContext.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/LinkingContext.h (original)
+++ lld/trunk/include/lld/Core/LinkingContext.h Tue Oct 8 19:57:22 2013
@@ -303,7 +303,7 @@ public:
/// nextFile returns the next file that needs to be processed by the resolver.
/// The LinkingContext's can override the default behavior to change the way
/// the resolver operates. This uses the currentInputElement. When there are
- /// no more files to be processed an appropriate input_graph_error is
+ /// no more files to be processed an appropriate InputGraphError is
/// returned.
virtual ErrorOr<File &> nextFile();
Modified: lld/trunk/include/lld/Driver/CoreInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/CoreInputGraph.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/CoreInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/CoreInputGraph.h Tue Oct 8 19:57:22 2013
@@ -63,7 +63,7 @@ public:
/// processed
virtual ErrorOr<File &> getNextFile() {
if (_files.size() == _nextFileIndex)
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
return *_files[_nextFileIndex++];
}
Modified: lld/trunk/include/lld/Driver/DarwinInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/DarwinInputGraph.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/DarwinInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/DarwinInputGraph.h Tue Oct 8 19:57:22 2013
@@ -54,7 +54,7 @@ public:
/// processed
virtual ErrorOr<File &> getNextFile() {
if (_files.size() == _nextFileIndex)
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
return *_files[_nextFileIndex++];
}
Modified: lld/trunk/include/lld/Driver/GnuLdInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/GnuLdInputGraph.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/GnuLdInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/GnuLdInputGraph.h Tue Oct 8 19:57:22 2013
@@ -127,7 +127,7 @@ public:
/// processed
virtual ErrorOr<File &> getNextFile() {
if (_nextFileIndex == _files.size())
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
return *_files[_nextFileIndex++];
}
@@ -175,7 +175,7 @@ public:
bool again = false;
// If there are no elements, move on to the next input element
if (_elements.size() == 0)
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
// If we have processed all the elements as part of this node
// check the resolver status for each input element and if the status
// has not changed, move onto the next file.
@@ -187,7 +187,7 @@ public:
}
}
if (!again)
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
_nextElementIndex = 0;
// Reset the next file to be processed as part of each element
for (auto &elem : _elements)
@@ -196,7 +196,7 @@ public:
auto file = _elements[_nextElementIndex]->getNextFile();
// Move on to the next element if we have finished processing all
// the files in the input element
- if (error_code(file) == input_graph_error::no_more_files)
+ if (error_code(file) == InputGraphError::no_more_files)
_nextElementIndex++;
else
return *file;
Modified: lld/trunk/include/lld/Driver/InputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/InputGraph.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/InputGraph.h (original)
+++ lld/trunk/include/lld/Driver/InputGraph.h Tue Oct 8 19:57:22 2013
@@ -381,7 +381,7 @@ public:
virtual ErrorOr<File &> getNextFile() {
if (_nextFileIndex == _files.size())
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
return *_files[_nextFileIndex++];
}
Modified: lld/trunk/include/lld/Driver/WinLinkInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/WinLinkInputGraph.h?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/WinLinkInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/WinLinkInputGraph.h Tue Oct 8 19:57:22 2013
@@ -70,7 +70,7 @@ public:
virtual ErrorOr<File &> getNextFile() {
if (_nextFileIndex == _files.size())
- return make_error_code(input_graph_error::no_more_files);
+ return make_error_code(InputGraphError::no_more_files);
return *_files[_nextFileIndex++];
}
Modified: lld/trunk/lib/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Error.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/Core/Error.cpp (original)
+++ lld/trunk/lib/Core/Error.cpp Tue Oct 8 19:57:22 2013
@@ -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;
}
Modified: lld/trunk/lib/Core/LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/LinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/Core/LinkingContext.cpp (original)
+++ lld/trunk/lib/Core/LinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -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;
}
}
Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Tue Oct 8 19:57:22 2013
@@ -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);
Modified: lld/trunk/lib/Driver/InputGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/InputGraph.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/Driver/InputGraph.cpp (original)
+++ lld/trunk/lib/Driver/InputGraph.cpp Tue Oct 8 19:57:22 2013
@@ -77,7 +77,7 @@ void InputGraph::insertOneElementAt(std:
/// \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();
}
Modified: lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -298,7 +298,7 @@ CoreLinkingContext::relocKindFromString(
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(
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);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -147,7 +147,7 @@ elf::HexagonLinkingContext::relocKindFro
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::stringFromRe
LLD_CASE(R_HEX_TPREL_11_X)
}
- return make_error_code(yaml_reader_error::illegal_value);
+ return make_error_code(YamlReaderError::illegal_value);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -15,7 +15,7 @@ elf::PPCLinkingContext::relocKindFromStr
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::stringFromRelocK
LLD_CASE(R_PPC_ADDR32)
}
- return make_error_code(yaml_reader_error::illegal_value);
+ return make_error_code(YamlReaderError::illegal_value);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -15,7 +15,7 @@ elf::X86LinkingContext::relocKindFromStr
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::stringFromRelocK
LLD_CASE(R_386_PC32)
}
- return make_error_code(yaml_reader_error::illegal_value);
+ return make_error_code(YamlReaderError::illegal_value);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -567,7 +567,7 @@ elf::X86_64LinkingContext::relocKindFrom
.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::stringFromRel
return std::string("LLD_R_X86_64_GOTRELINDEX");
}
- return make_error_code(yaml_reader_error::illegal_value);
+ return make_error_code(YamlReaderError::illegal_value);
}
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp Tue Oct 8 19:57:22 2013
@@ -622,7 +622,7 @@ readYaml(std::unique_ptr<MemoryBuffer> &
// 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);
Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Tue Oct 8 19:57:22 2013
@@ -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 {
Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Tue Oct 8 19:57:22 2013
@@ -121,12 +121,12 @@ Writer &PECOFFLinkingContext::writer() c
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 {
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Tue Oct 8 19:57:22 2013
@@ -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
// 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>(
Modified: lld/trunk/lib/ReaderWriter/ReaderLinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ReaderLinkerScript.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ReaderLinkerScript.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ReaderLinkerScript.cpp Tue Oct 8 19:57:22 2013
@@ -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);
}
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=192261&r1=192260&r2=192261&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Tue Oct 8 19:57:22 2013
@@ -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
More information about the llvm-commits
mailing list