[cfe-commits] r69260 - /cfe/trunk/include/clang/Basic/Diagnostic.h
Chris Lattner
sabre at nondot.org
Wed Apr 15 20:41:46 PDT 2009
Author: lattner
Date: Wed Apr 15 22:41:37 2009
New Revision: 69260
URL: http://llvm.org/viewvc/llvm-project?rev=69260&view=rev
Log:
switch DiagMappings *back* to 4 bits per diag.
Modified:
cfe/trunk/include/clang/Basic/Diagnostic.h
Modified: cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=69260&r1=69259&r2=69260&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.h Wed Apr 15 22:41:37 2009
@@ -155,7 +155,7 @@
/// 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 @@
/// 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 @@
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;
}
More information about the cfe-commits
mailing list