summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-26 21:58:53 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-26 21:58:53 +0000
commit46f87dcad48b1eee897a3da0c8c1acb62b464880 (patch)
tree7ef322503ccfb5ef15d34434bbe055d3f9582508
parent37d8015dc1e09de96e32be45a70cb53b9fe118db (diff)
downloadbcm5719-llvm-46f87dcad48b1eee897a3da0c8c1acb62b464880.tar.gz
bcm5719-llvm-46f87dcad48b1eee897a3da0c8c1acb62b464880.zip
Make Decl::dump const.
llvm-svn: 82878
-rw-r--r--clang/include/clang/AST/DeclBase.h6
-rw-r--r--clang/lib/AST/DeclPrinter.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index f60d36fc3d9..f05574fcceb 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -456,13 +456,13 @@ public:
/// Destroy - Call destructors and release memory.
virtual void Destroy(ASTContext& C);
- void print(llvm::raw_ostream &Out, unsigned Indentation = 0);
+ void print(llvm::raw_ostream &Out, unsigned Indentation = 0) const;
void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy,
- unsigned Indentation = 0);
+ unsigned Indentation = 0) const;
static void printGroup(Decl** Begin, unsigned NumDecls,
llvm::raw_ostream &Out, const PrintingPolicy &Policy,
unsigned Indentation = 0);
- void dump();
+ void dump() const;
private:
const Attr *getAttrsImpl() const;
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index f448144d282..9d0d836cf62 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -77,14 +77,14 @@ namespace {
};
}
-void Decl::print(llvm::raw_ostream &Out, unsigned Indentation) {
+void Decl::print(llvm::raw_ostream &Out, unsigned Indentation) const {
print(Out, getASTContext().PrintingPolicy, Indentation);
}
void Decl::print(llvm::raw_ostream &Out, const PrintingPolicy &Policy,
- unsigned Indentation) {
+ unsigned Indentation) const {
DeclPrinter Printer(Out, getASTContext(), Policy, Indentation);
- Printer.Visit(this);
+ Printer.Visit(const_cast<Decl*>(this));
}
static QualType GetBaseType(QualType T) {
@@ -149,7 +149,7 @@ void Decl::printGroup(Decl** Begin, unsigned NumDecls,
}
}
-void Decl::dump() {
+void Decl::dump() const {
print(llvm::errs());
}
OpenPOWER on IntegriCloud