Constify ASTLocation::print.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 29 Jul 2009 23:39:35 +0000 (23:39 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 29 Jul 2009 23:39:35 +0000 (23:39 +0000)
llvm-svn: 77532

clang/include/clang/Index/ASTLocation.h
clang/lib/Index/ASTLocation.cpp

index 34ce9c3..3fd9928 100644 (file)
@@ -81,7 +81,7 @@ public:
     return !(L == R);
   }
   
-  void print(llvm::raw_ostream &OS);
+  void print(llvm::raw_ostream &OS) const;
 };
 
 } // namespace idx
index 55a90fa..d528c5a 100644 (file)
@@ -117,14 +117,14 @@ SourceRange ASTLocation::getSourceRange() const {
   return isDecl() ? getDecl()->getSourceRange() : getStmt()->getSourceRange();
 }
 
-void ASTLocation::print(llvm::raw_ostream &OS) {
+void ASTLocation::print(llvm::raw_ostream &OS) const {
   if (isInvalid()) {
     OS << "<< Invalid ASTLocation >>\n";
     return;
   }
 
   OS << "[Decl: " << getDecl()->getDeclKindName() << " ";
-  if (NamedDecl *ND = dyn_cast<NamedDecl>(getDecl()))
+  if (const NamedDecl *ND = dyn_cast<NamedDecl>(getDecl()))
     OS << ND->getNameAsString();
   
   if (getStmt()) {