[cfe-commits] r116797 - /cfe/trunk/include/clang/AST/DeclBase.h

John McCall rjmccall at apple.com
Mon Oct 18 22:43:52 PDT 2010


Author: rjmccall
Date: Tue Oct 19 00:43:52 2010
New Revision: 116797

URL: http://llvm.org/viewvc/llvm-project?rev=116797&view=rev
Log:
MSVC space optimization.


Modified:
    cfe/trunk/include/clang/AST/DeclBase.h

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=116797&r1=116796&r2=116797&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Tue Oct 19 00:43:52 2010
@@ -201,21 +201,21 @@
   SourceLocation Loc;
 
   /// DeclKind - This indicates which class this is.
-  Kind DeclKind   :  8;
+  unsigned DeclKind : 8;
 
   /// InvalidDecl - This indicates a semantic error occurred.
-  unsigned int InvalidDecl :  1;
+  unsigned InvalidDecl :  1;
 
   /// HasAttrs - This indicates whether the decl has attributes or not.
-  unsigned int HasAttrs : 1;
+  unsigned HasAttrs : 1;
 
   /// Implicit - Whether this declaration was implicitly generated by
   /// the implementation rather than explicitly written by the user.
-  bool Implicit : 1;
+  unsigned Implicit : 1;
 
   /// \brief Whether this declaration was "used", meaning that a definition is
   /// required.
-  bool Used : 1;
+  unsigned Used : 1;
 
 protected:
   /// Access - Used by C++ decls for the access specifier.
@@ -227,7 +227,7 @@
   unsigned PCHLevel : 2;
 
   /// ChangedAfterLoad - if this declaration has changed since being loaded
-  bool ChangedAfterLoad : 1;
+  unsigned ChangedAfterLoad : 1;
 
   /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
   unsigned IdentifierNamespace : 15;
@@ -272,7 +272,7 @@
   SourceLocation getLocation() const { return Loc; }
   void setLocation(SourceLocation L) { Loc = L; }
 
-  Kind getKind() const { return DeclKind; }
+  Kind getKind() const { return static_cast<Kind>(DeclKind); }
   const char *getDeclKindName() const;
 
   Decl *getNextDeclInContext() { return NextDeclInContext; }
@@ -681,17 +681,17 @@
 ///
 class DeclContext {
   /// DeclKind - This indicates which class this is.
-  Decl::Kind DeclKind   :  8;
+  unsigned DeclKind : 8;
 
   /// \brief Whether this declaration context also has some external
   /// storage that contains additional declarations that are lexically
   /// part of this context.
-  mutable bool ExternalLexicalStorage : 1;
+  mutable unsigned ExternalLexicalStorage : 1;
 
   /// \brief Whether this declaration context also has some external
   /// storage that contains additional declarations that are visible
   /// in this context.
-  mutable bool ExternalVisibleStorage : 1;
+  mutable unsigned ExternalVisibleStorage : 1;
 
   /// \brief Pointer to the data structure used to lookup declarations
   /// within this context (or a DependentStoredDeclsMap if this is a
@@ -726,7 +726,7 @@
   ~DeclContext();
 
   Decl::Kind getDeclKind() const {
-    return DeclKind;
+    return static_cast<Decl::Kind>(DeclKind);
   }
   const char *getDeclKindName() const;
 





More information about the cfe-commits mailing list