llvm.org GIT mirror llvm / 9b29ea4
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 Jim Grosbach 8 years ago
1 changed file(s) with 13 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1616 #include "llvm/TableGen/Record.h"
1717 #include "llvm/ADT/StringExtras.h"
1818 #include "llvm/ADT/STLExtras.h"
19 #include "llvm/ADT/Twine.h"
1920 #include "llvm/Support/Debug.h"
2021 #include "llvm/Support/ErrorHandling.h"
2122 #include
24822483 // If we decided that this is a store from the pattern, then the .td file
24832484 // entry is redundant.
24842485 if (MayStore)
2485 fprintf(stderr,
2486 "Warning: mayStore flag explicitly set on instruction '%s'"
2487 " but flag already inferred from pattern.\n",
2488 Inst.TheDef->getName().c_str());
2486 PrintWarning(Inst.TheDef->getLoc(),
2487 Twine("Warning: mayStore flag explicitly set on ") +
2488 "instruction, but flag already inferred from pattern.\n");
24892489 MayStore = true;
24902490 }
24912491
24932493 // If we decided that this is a load from the pattern, then the .td file
24942494 // entry is redundant.
24952495 if (MayLoad)
2496 fprintf(stderr,
2497 "Warning: mayLoad flag explicitly set on instruction '%s'"
2498 " but flag already inferred from pattern.\n",
2499 Inst.TheDef->getName().c_str());
2496 PrintWarning(Inst.TheDef->getLoc(),
2497 Twine("Warning: mayLoad flag explicitly set on ") +
2498 "instruction, but flag already inferred from pattern.\n");
25002499 MayLoad = true;
25012500 }
25022501
25032502 if (Inst.neverHasSideEffects) {
25042503 if (HadPattern)
2505 fprintf(stderr, "Warning: neverHasSideEffects set on instruction '%s' "
2506 "which already has a pattern\n", Inst.TheDef->getName().c_str());
2504 PrintWarning(Inst.TheDef->getLoc(),
2505 Twine("Warning: neverHasSideEffects flag explicitly set on ") +
2506 "instruction, but flag already inferred from pattern.\n");
25072507 HasSideEffects = false;
25082508 }
25092509
25102510 if (Inst.hasSideEffects) {
25112511 if (HasSideEffects)
2512 fprintf(stderr, "Warning: hasSideEffects set on instruction '%s' "
2513 "which already inferred this.\n", Inst.TheDef->getName().c_str());
2512 PrintWarning(Inst.TheDef->getLoc(),
2513 Twine("Warning: hasSideEffects flag explicitly set on ") +
2514 "instruction, but flag already inferred from pattern.\n");
25142515 HasSideEffects = true;
25152516 }
25162517