replace llvm::error_code with std::error_code.

llvm-svn: 210781
This commit is contained in:
Rafael Espindola 2014-06-12 14:04:54 +00:00
parent c080917ec2
commit 4956850fdc
6 changed files with 20 additions and 21 deletions

View File

@ -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

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}