diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-04-18 17:46:41 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-04-18 17:46:41 +0000 |
commit | 9b29ea4eb39b5f03ef2405c6355a9c627771c5dd (patch) | |
tree | 36e153642ccd0f70260880d722716a94c83ee8cc /utils | |
parent | 4b18691c3580674691875ec37c84a1c4edf2d586 (diff) |
TableGen use PrintWarning rather than fprintf(stderr,...) for warnings.
That way we get source line number information from the diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index d2ddf232b3..665a5f113a 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -17,6 +17,7 @@ #include "llvm/TableGen/Record.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include <algorithm> @@ -2483,10 +2484,9 @@ static void InferFromPattern(const CodeGenInstruction &Inst, // If we decided that this is a store from the pattern, then the .td file // entry is redundant. if (MayStore) - fprintf(stderr, - "Warning: mayStore flag explicitly set on instruction '%s'" - " but flag already inferred from pattern.\n", - Inst.TheDef->getName().c_str()); + PrintWarning(Inst.TheDef->getLoc(), + Twine("Warning: mayStore flag explicitly set on ") + + "instruction, but flag already inferred from pattern.\n"); MayStore = true; } @@ -2494,24 +2494,25 @@ static void InferFromPattern(const CodeGenInstruction &Inst, // If we decided that this is a load from the pattern, then the .td file // entry is redundant. if (MayLoad) - fprintf(stderr, - "Warning: mayLoad flag explicitly set on instruction '%s'" - " but flag already inferred from pattern.\n", - Inst.TheDef->getName().c_str()); + PrintWarning(Inst.TheDef->getLoc(), + Twine("Warning: mayLoad flag explicitly set on ") + + "instruction, but flag already inferred from pattern.\n"); MayLoad = true; } if (Inst.neverHasSideEffects) { if (HadPattern) - fprintf(stderr, "Warning: neverHasSideEffects set on instruction '%s' " - "which already has a pattern\n", Inst.TheDef->getName().c_str()); + PrintWarning(Inst.TheDef->getLoc(), + Twine("Warning: neverHasSideEffects flag explicitly set on ") + + "instruction, but flag already inferred from pattern.\n"); HasSideEffects = false; } if (Inst.hasSideEffects) { if (HasSideEffects) - fprintf(stderr, "Warning: hasSideEffects set on instruction '%s' " - "which already inferred this.\n", Inst.TheDef->getName().c_str()); + PrintWarning(Inst.TheDef->getLoc(), + Twine("Warning: hasSideEffects flag explicitly set on ") + + "instruction, but flag already inferred from pattern.\n"); HasSideEffects = true; } |