llvm.org GIT mirror llvm / 97c02bf
TableGen add warning diagnostic helper functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155012 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Grosbach 8 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2828 const std::string &getMessage() const { return Message; }
2929 };
3030
31 void PrintWarning(SMLoc WarningLoc, const Twine &Msg);
32 void PrintWarning(const char *Loc, const Twine &Msg);
33 void PrintWarning(const Twine &Msg);
34 void PrintWarning(const TGError &Warning);
35
3136 void PrintError(SMLoc ErrorLoc, const Twine &Msg);
3237 void PrintError(const char *Loc, const Twine &Msg);
3338 void PrintError(const Twine &Msg);
1919
2020 SourceMgr SrcMgr;
2121
22 void PrintWarning(SMLoc WarningLoc, const Twine &Msg) {
23 SrcMgr.PrintMessage(WarningLoc, SourceMgr::DK_Warning, Msg);
24 }
25
26 void PrintWarning(const char *Loc, const Twine &Msg) {
27 SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Warning, Msg);
28 }
29
30 void PrintWarning(const Twine &Msg) {
31 errs() << "error:" << Msg << "\n";
32 }
33
34 void PrintWarning(const TGError &Warning) {
35 PrintWarning(Warning.getLoc(), Warning.getMessage());
36 }
37
2238 void PrintError(SMLoc ErrorLoc, const Twine &Msg) {
2339 SrcMgr.PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg);
2440 }