aboutsummaryrefslogtreecommitdiff
path: root/lib/TableGen
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-04-18 17:46:31 +0000
committerJim Grosbach <grosbach@apple.com>2012-04-18 17:46:31 +0000
commit97c02bf2409bccdb43c3822c438e3ff977d8514e (patch)
tree5d6a506d74b0726b81c34409f1fbb62317b03a11 /lib/TableGen
parentf5782e2d607aa86c894b15d20bd067d4b772389a (diff)
TableGen add warning diagnostic helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-rw-r--r--lib/TableGen/Error.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp
index 5071ee77ac..369e3c1623 100644
--- a/lib/TableGen/Error.cpp
+++ b/lib/TableGen/Error.cpp
@@ -20,6 +20,22 @@ namespace llvm {
SourceMgr SrcMgr;
+void PrintWarning(SMLoc WarningLoc, const Twine &Msg) {
+ SrcMgr.PrintMessage(WarningLoc, SourceMgr::DK_Warning, Msg);
+}
+
+void PrintWarning(const char *Loc, const Twine &Msg) {
+ SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Warning, Msg);
+}
+
+void PrintWarning(const Twine &Msg) {
+ errs() << "error:" << Msg << "\n";
+}
+
+void PrintWarning(const TGError &Warning) {
+ PrintWarning(Warning.getLoc(), Warning.getMessage());
+}
+
void PrintError(SMLoc ErrorLoc, const Twine &Msg) {
SrcMgr.PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg);
}