From 4a0beb20655ae9f28d519e088c6ec8dceec59edd Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 6 Jul 2012 22:00:04 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159868 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceLocation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 3bac26fbae..d6bba38563 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -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); } -- 2.50.1