[cfe-commits] r63588 - /cfe/trunk/include/clang/Basic/SourceManager.h

Chris Lattner sabre at nondot.org
Mon Feb 2 17:28:06 PST 2009


Author: lattner
Date: Mon Feb  2 19:28:04 2009
New Revision: 63588

URL: http://llvm.org/viewvc/llvm-project?rev=63588&view=rev
Log:
Content Cache only needs to be 4-byte aligned.  Since it is stored in
an std::set, we can't make a strong guarantee about what its alignment
will be.  Since I don't need the 3rd bit anyway yet, just change the
assertion.

Modified:
    cfe/trunk/include/clang/Basic/SourceManager.h

Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=63588&r1=63587&r2=63588&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Mon Feb  2 19:28:04 2009
@@ -143,7 +143,7 @@
       FileInfo X;
       X.IncludeLoc = IL.getRawEncoding();
       X.Data = (uintptr_t)Con;
-      assert((X.Data & 7) == 0 &&"ContentCache pointer insufficiently aligned");
+      assert((X.Data & 3) == 0 &&"ContentCache pointer insufficiently aligned");
       assert((unsigned)FileCharacter < 4 && "invalid file character");
       X.Data |= (unsigned)FileCharacter;
       return X;
@@ -153,7 +153,7 @@
       return SourceLocation::getFromRawEncoding(IncludeLoc);
     }
     const ContentCache* getContentCache() const {
-      return reinterpret_cast<const ContentCache*>(Data & ~7UL);
+      return reinterpret_cast<const ContentCache*>(Data & ~3UL);
     }
     
     /// getCharacteristic - Return whether this is a system header or not.





More information about the cfe-commits mailing list