Skip to content

Commit

Permalink
[dsymutil] Make the warn and error helpers globally available. NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246010 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
fredriss committed Aug 26, 2015
1 parent fe89383 commit 93639d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tools/dsymutil/DwarfLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename KeyT, typename ValT>
using HalfOpenIntervalMap =
IntervalMap<KeyT, ValT, IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize,
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions tools/dsymutil/dsymutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 93639d3

Please sign in to comment.