[cfe-commits] r143193 - in /cfe/trunk/tools/libclang: CIndexUSRs.cpp IndexingContext.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Oct 28 06:37:12 PDT 2011


Author: d0k
Date: Fri Oct 28 08:37:11 2011
New Revision: 143193

URL: http://llvm.org/viewvc/llvm-project?rev=143193&view=rev
Log:
Use const_cast to make it obvious that it's just removing constness (and silence warnings).

Modified:
    cfe/trunk/tools/libclang/CIndexUSRs.cpp
    cfe/trunk/tools/libclang/IndexingContext.cpp

Modified: cfe/trunk/tools/libclang/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexUSRs.cpp?rev=143193&r1=143192&r2=143193&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexUSRs.cpp Fri Oct 28 08:37:11 2011
@@ -817,7 +817,7 @@
 
   {
     USRGenerator UG(&D->getASTContext(), &Buf);
-    UG->Visit((Decl*)D);
+    UG->Visit(const_cast<Decl*>(D));
 
     if (UG->ignoreResults())
       return true;

Modified: cfe/trunk/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=143193&r1=143192&r2=143193&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)
+++ cfe/trunk/tools/libclang/IndexingContext.cpp Fri Oct 28 08:37:11 2011
@@ -397,9 +397,11 @@
   if (isNotFromSourceFile(D->getLocation()))
     return;
 
-  CXIdxEntityRefInfo Info = { E ? MakeCXCursor((Stmt*)E,
-                                               (Decl*)cast<Decl>(DC), CXTU)
-                                : getRefCursor(D, Loc),
+  CXCursor Cursor = E ? MakeCXCursor(const_cast<Expr*>(E),
+                                     const_cast<Decl*>(cast<Decl>(DC)), CXTU)
+                      : getRefCursor(D, Loc);
+
+  CXIdxEntityRefInfo Info = { Cursor,
                               getIndexLoc(Loc),
                               getIndexEntity(D),
                               getIndexEntity(Parent),





More information about the cfe-commits mailing list