diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-07-18 18:24:41 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-07-18 18:24:41 +0000 |
commit | 2ec79a60cbbbee1721ede6b7a1e086d7b4428889 (patch) | |
tree | 1efc091c922f1eaee16af99f53cdc83890854dbd | |
parent | ad1ffe7c8a581c4328ac13c80c9fd746390fcfce (diff) |
Delete dead code.
And make it easier to spot code going dead by using elf::.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275858 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | ELF/Error.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/ELF/Error.cpp b/ELF/Error.cpp index 59a49c17b..776fc72a2 100644 --- a/ELF/Error.cpp +++ b/ELF/Error.cpp @@ -17,49 +17,38 @@ using namespace llvm; namespace lld { -namespace elf { -bool HasError; -raw_ostream *ErrorOS; +bool elf::HasError; +raw_ostream *elf::ErrorOS; -void log(const Twine &Msg) { +void elf::log(const Twine &Msg) { if (Config->Verbose) outs() << Msg << "\n"; } -void warning(const Twine &Msg) { +void elf::warning(const Twine &Msg) { if (Config->FatalWarnings) error(Msg); else *ErrorOS << Msg << "\n"; } -void error(const Twine &Msg) { +void elf::error(const Twine &Msg) { *ErrorOS << Msg << "\n"; HasError = true; } -void error(std::error_code EC, const Twine &Prefix) { +void elf::error(std::error_code EC, const Twine &Prefix) { error(Prefix + ": " + EC.message()); } -void fatal(const Twine &Msg) { +void elf::fatal(const Twine &Msg) { *ErrorOS << Msg << "\n"; exit(1); } -void fatal(const Twine &Msg, const Twine &Prefix) { +void elf::fatal(const Twine &Msg, const Twine &Prefix) { fatal(Prefix + ": " + Msg); } -void check(std::error_code EC) { - if (EC) - fatal(EC.message()); -} - -void check(Error Err) { - check(errorToErrorCode(std::move(Err))); -} - -} // namespace elf } // namespace lld |