From: Argyrios Kyrtzidis Date: Wed, 29 Jul 2009 23:39:35 +0000 (+0000) Subject: Constify ASTLocation::print. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dbbc0e20a648cb2a9d520f5a7a394a6c07d6c68;p=clang Constify ASTLocation::print. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77532 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Index/ASTLocation.h b/include/clang/Index/ASTLocation.h index 34ce9c37af..3fd99289f5 100644 --- a/include/clang/Index/ASTLocation.h +++ b/include/clang/Index/ASTLocation.h @@ -81,7 +81,7 @@ public: return !(L == R); } - void print(llvm::raw_ostream &OS); + void print(llvm::raw_ostream &OS) const; }; } // namespace idx diff --git a/lib/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp index 55a90fad8d..d528c5ac5f 100644 --- a/lib/Index/ASTLocation.cpp +++ b/lib/Index/ASTLocation.cpp @@ -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(getDecl())) + if (const NamedDecl *ND = dyn_cast(getDecl())) OS << ND->getNameAsString(); if (getStmt()) {