]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77532 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 34ce9c37af62b322deba1f99261b6a0af47bb400..3fd99289f5af510a39b06fc1f6bee75a54990ed6 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 55a90fad8dcc4aa0c383202961f339629b7c9168..d528c5ac5f9fc2faa5be7e9557e6832462c542e2 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()) {