From: Chris Lattner Date: Thu, 16 Apr 2009 03:41:37 +0000 (+0000) Subject: switch DiagMappings *back* to 4 bits per diag. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e29cc89f82261ad899791f47d1c1d9ef91e172b6;p=clang switch DiagMappings *back* to 4 bits per diag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69260 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 7d2dc689de..6ac2494d07 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -155,7 +155,7 @@ private: /// DiagMappings - Mapping information for diagnostics. Mapping info is /// packed into two bits per diagnostic. - unsigned char DiagMappings[diag::DIAG_UPPER_LIMIT/4]; + unsigned char DiagMappings[diag::DIAG_UPPER_LIMIT/2]; /// ErrorOccurred / FatalErrorOccurred - This is set to true when an error or /// fatal error is emitted, and is sticky. @@ -231,7 +231,7 @@ public: /// getDiagnosticMapping - Return the mapping currently set for the specified /// diagnostic. diag::Mapping getDiagnosticMapping(diag::kind Diag) const { - return (diag::Mapping)((DiagMappings[Diag/4] >> (Diag & 3)*2) & 3); + return (diag::Mapping)((DiagMappings[Diag/2] >> (Diag & 1)*4) & 7); } bool hasErrorOccurred() const { return ErrorOccurred; } @@ -302,9 +302,9 @@ public: private: void setDiagnosticMappingInternal(unsigned Diag, unsigned Map) { - unsigned char &Slot = DiagMappings[Diag/4]; - unsigned Bits = (Diag & 3)*2; - Slot &= ~(3 << Bits); + unsigned char &Slot = DiagMappings[Diag/2]; + unsigned Bits = (Diag & 1)*4; + Slot &= ~(7 << Bits); Slot |= Map << Bits; }