From 93639d33f7e19067c6be8fb128012b2a79c68d7b Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Wed, 26 Aug 2015 05:09:55 +0000 Subject: [PATCH] [dsymutil] Make the warn and error helpers globally available. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246010 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/dsymutil/DwarfLinker.cpp | 22 +++++++++++----------- tools/dsymutil/dsymutil.h | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/dsymutil/DwarfLinker.cpp b/tools/dsymutil/DwarfLinker.cpp index 5d9a4f86329..0be12375b26 100644 --- a/tools/dsymutil/DwarfLinker.cpp +++ b/tools/dsymutil/DwarfLinker.cpp @@ -44,17 +44,6 @@ namespace dsymutil { namespace { -void warn(const Twine &Warning, const Twine &Context) { - errs() << Twine("while processing ") + Context + ":\n"; - errs() << Twine("warning: ") + Warning + "\n"; -} - -bool error(const Twine &Error, const Twine &Context) { - errs() << Twine("while processing ") + Context + ":\n"; - errs() << Twine("error: ") + Error + "\n"; - return false; -} - template using HalfOpenIntervalMap = IntervalMap::LeafSize, @@ -3090,6 +3079,17 @@ StringRef NonRelocatableStringpool::internString(StringRef S) { return InsertResult.first->getKey(); } +void warn(const Twine &Warning, const Twine &Context) { + errs() << Twine("while processing ") + Context + ":\n"; + errs() << Twine("warning: ") + Warning + "\n"; +} + +bool error(const Twine &Error, const Twine &Context) { + errs() << Twine("while processing ") + Context + ":\n"; + errs() << Twine("error: ") + Error + "\n"; + return false; +} + bool linkDwarf(StringRef OutputFilename, const DebugMap &DM, const LinkOptions &Options) { DwarfLinker Linker(OutputFilename, Options); diff --git a/tools/dsymutil/dsymutil.h b/tools/dsymutil/dsymutil.h index 239439a6a86..6a94063f282 100644 --- a/tools/dsymutil/dsymutil.h +++ b/tools/dsymutil/dsymutil.h @@ -48,6 +48,9 @@ bool linkDwarf(StringRef OutputFilename, const DebugMap &DM, /// \brief Exit the dsymutil process, cleaning up every temporary /// files that we created. LLVM_ATTRIBUTE_NORETURN void exitDsymutil(int ExitStatus); + +void warn(const Twine &Warning, const Twine &Context); +bool error(const Twine &Error, const Twine &Context); } } #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H -- 2.11.0