diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-12-22 15:31:57 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-12-22 15:31:57 +0000 |
commit | a6eb16ed631365f3bbadd0450ab52746c151794d (patch) | |
tree | ca4191aa3946aaad2c7b20f4ffa1207a3c16c692 /utils | |
parent | c98f5f226b27512367700c50c6fb477d663e5c95 (diff) |
Improving this fatal diagnostic to help checker developers figure out what's actually gone wrong when they hit it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangSACheckersEmitter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/TableGen/ClangSACheckersEmitter.cpp b/utils/TableGen/ClangSACheckersEmitter.cpp index 453dfe564b..57850a4387 100644 --- a/utils/TableGen/ClangSACheckersEmitter.cpp +++ b/utils/TableGen/ClangSACheckersEmitter.cpp @@ -58,7 +58,7 @@ static std::string getStringValue(const Record &R, StringRef field) { } // Calculates the integer value representing the BitsInit object -static inline uint64_t getValueFromBitsInit(const BitsInit *B) { +static inline uint64_t getValueFromBitsInit(const BitsInit *B, const Record &R) { assert(B->getNumBits() <= sizeof(uint64_t) * 8 && "BitInits' too long!"); uint64_t Value = 0; @@ -67,7 +67,8 @@ static inline uint64_t getValueFromBitsInit(const BitsInit *B) { if (Bit) Value |= uint64_t(Bit->getValue()) << i; else - PrintFatalError("Invalid bits"); + PrintFatalError(R.getLoc(), + "missing Documentation for " + getCheckerFullName(&R)); } return Value; } @@ -75,7 +76,7 @@ static inline uint64_t getValueFromBitsInit(const BitsInit *B) { static std::string getCheckerDocs(const Record &R) { StringRef LandingPage; if (BitsInit *BI = R.getValueAsBitsInit("Documentation")) { - uint64_t V = getValueFromBitsInit(BI); + uint64_t V = getValueFromBitsInit(BI, R); if (V == 1) LandingPage = "available_checks.html"; else if (V == 2) |