]> granicus.if.org Git - clang/commitdiff
switch DiagMappings *back* to 4 bits per diag.
authorChris Lattner <sabre@nondot.org>
Thu, 16 Apr 2009 03:41:37 +0000 (03:41 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 16 Apr 2009 03:41:37 +0000 (03:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69260 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Diagnostic.h

index 7d2dc689de4267db58118032cc8f06c662048b72..6ac2494d0724c9940ccd340241e9bba80b5e6539 100644 (file)
@@ -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;
   }