forked from OSchip/llvm-project
replace llvm::error_code with std::error_code.
llvm-svn: 210781
This commit is contained in:
parent
c080917ec2
commit
4956850fdc
|
@ -30,8 +30,8 @@ enum class NativeReaderError {
|
|||
memory_error,
|
||||
};
|
||||
|
||||
inline llvm::error_code make_error_code(NativeReaderError e) {
|
||||
return llvm::error_code(static_cast<int>(e), native_reader_category());
|
||||
inline std::error_code make_error_code(NativeReaderError e) {
|
||||
return std::error_code(static_cast<int>(e), native_reader_category());
|
||||
}
|
||||
|
||||
const std::error_category &YamlReaderCategory();
|
||||
|
@ -42,8 +42,8 @@ enum class YamlReaderError {
|
|||
illegal_value
|
||||
};
|
||||
|
||||
inline llvm::error_code make_error_code(YamlReaderError e) {
|
||||
return llvm::error_code(static_cast<int>(e), YamlReaderCategory());
|
||||
inline std::error_code make_error_code(YamlReaderError e) {
|
||||
return std::error_code(static_cast<int>(e), YamlReaderCategory());
|
||||
}
|
||||
|
||||
const std::error_category &LinkerScriptReaderCategory();
|
||||
|
@ -53,8 +53,8 @@ enum class LinkerScriptReaderError {
|
|||
parse_error
|
||||
};
|
||||
|
||||
inline llvm::error_code make_error_code(LinkerScriptReaderError e) {
|
||||
return llvm::error_code(static_cast<int>(e), LinkerScriptReaderCategory());
|
||||
inline std::error_code make_error_code(LinkerScriptReaderError e) {
|
||||
return std::error_code(static_cast<int>(e), LinkerScriptReaderCategory());
|
||||
}
|
||||
|
||||
/// \brief Errors returned by InputGraph functionality
|
||||
|
@ -67,8 +67,8 @@ enum class InputGraphError {
|
|||
no_more_files
|
||||
};
|
||||
|
||||
inline llvm::error_code make_error_code(InputGraphError e) {
|
||||
return llvm::error_code(static_cast<int>(e), InputGraphErrorCategory());
|
||||
inline std::error_code make_error_code(InputGraphError e) {
|
||||
return std::error_code(static_cast<int>(e), InputGraphErrorCategory());
|
||||
}
|
||||
|
||||
/// \brief Errors returned by Reader.
|
||||
|
@ -79,8 +79,8 @@ enum class ReaderError {
|
|||
unknown_file_format = 1
|
||||
};
|
||||
|
||||
inline llvm::error_code make_error_code(ReaderError e) {
|
||||
return llvm::error_code(static_cast<int>(e), ReaderErrorCategory());
|
||||
inline std::error_code make_error_code(ReaderError e) {
|
||||
return std::error_code(static_cast<int>(e), ReaderErrorCategory());
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,8 +90,8 @@ inline llvm::error_code make_error_code(ReaderError e) {
|
|||
/// supplied error string.
|
||||
/// Note: Once ErrorOr<> is updated to work with errors other than error_code,
|
||||
/// this can be updated to return some other kind of error.
|
||||
llvm::error_code make_dynamic_error_code(StringRef msg);
|
||||
llvm::error_code make_dynamic_error_code(const Twine &msg);
|
||||
std::error_code make_dynamic_error_code(StringRef msg);
|
||||
std::error_code make_dynamic_error_code(const Twine &msg);
|
||||
|
||||
} // end namespace lld
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace lld {
|
|||
using llvm::SaveAndRestore;
|
||||
using llvm::ErrorOr;
|
||||
|
||||
using llvm::error_code;
|
||||
using std::error_code;
|
||||
using llvm::raw_ostream;
|
||||
} // end namespace lld.
|
||||
|
||||
|
|
|
@ -209,13 +209,12 @@ private:
|
|||
|
||||
static dynamic_error_category categorySingleton;
|
||||
|
||||
|
||||
llvm::error_code make_dynamic_error_code(StringRef msg) {
|
||||
return llvm::error_code(categorySingleton.add(msg), categorySingleton);
|
||||
std::error_code make_dynamic_error_code(StringRef msg) {
|
||||
return std::error_code(categorySingleton.add(msg), categorySingleton);
|
||||
}
|
||||
|
||||
llvm::error_code make_dynamic_error_code(const Twine &msg) {
|
||||
return llvm::error_code(categorySingleton.add(msg.str()), categorySingleton);
|
||||
std::error_code make_dynamic_error_code(const Twine &msg) {
|
||||
return std::error_code(categorySingleton.add(msg.str()), categorySingleton);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
|
||||
using llvm::StringRef;
|
||||
using llvm::error_code;
|
||||
using std::error_code;
|
||||
using namespace llvm::yaml;
|
||||
using namespace llvm::MachO;
|
||||
using namespace lld::mach_o::normalized;
|
||||
|
|
|
@ -24,7 +24,7 @@ using llvm::MemoryBuffer;
|
|||
using llvm::SmallString;
|
||||
using llvm::Twine;
|
||||
using llvm::ErrorOr;
|
||||
using llvm::error_code;
|
||||
using std::error_code;
|
||||
using namespace llvm::MachO;
|
||||
using namespace lld::mach_o::normalized;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static std::unique_ptr<NormalizedFile> fromYAML(StringRef str) {
|
|||
|
||||
static void toYAML(const NormalizedFile &f, std::string &out) {
|
||||
llvm::raw_string_ostream ostr(out);
|
||||
llvm::error_code ec = lld::mach_o::normalized::writeYaml(f, ostr);
|
||||
std::error_code ec = lld::mach_o::normalized::writeYaml(f, ostr);
|
||||
EXPECT_TRUE(!ec);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue