]> granicus.if.org Git - clang/commitdiff
Constify the argument to SourceLocation::getFromPtrEncoding.
authorJordan Rose <jordan_rose@apple.com>
Fri, 6 Jul 2012 22:00:04 +0000 (22:00 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 6 Jul 2012 22:00:04 +0000 (22:00 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159868 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceLocation.h

index 3bac26fbaecf4826882593e651dc7a7be1cd34e5..d6bba385633d0c2190eda5a3c078c4414fe51660 100644 (file)
@@ -166,7 +166,7 @@ public:
 
   /// 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);
   }