[cfe-commits] r159868 - /cfe/trunk/include/clang/Basic/SourceLocation.h

Jordan Rose jordan_rose at apple.com
Fri Jul 6 15:00:04 PDT 2012

Author: jrose
Date: Fri Jul  6 17:00:04 2012
New Revision: 159868

URL: http://llvm.org/viewvc/llvm-project?rev=159868&view=rev
Constify the argument to SourceLocation::getFromPtrEncoding.

This allows SourceLocations to be stored in generic "data" fields
that are typed as "const void *" and are also used to point to
const objects.

Really we should probably be returning a const pointer from
getPtrEncoding as well, but in some places we want to store
SourceLocations in the same generic "data" field as proper
pointers to /mutable/ objects. Oh well.


Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=159868&r1=159867&r2=159868&view=diff
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Fri Jul  6 17:00:04 2012
@@ -166,7 +166,7 @@
   /// getFromPtrEncoding - Turn a pointer encoding of a SourceLocation object
   /// into a real SourceLocation.
-  static SourceLocation getFromPtrEncoding(void *Encoding) {
+  static SourceLocation getFromPtrEncoding(const void *Encoding) {
     return getFromRawEncoding((unsigned)(uintptr_t)Encoding);

More information about the cfe-commits mailing list