summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/AST/Decl.h2
-rw-r--r--clang/include/clang/AST/ExternalASTSource.h7
-rw-r--r--clang/include/clang/Frontend/PCHReader.h4
-rw-r--r--clang/lib/Frontend/PCHReader.cpp7
4 files changed, 13 insertions, 7 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index da3459a0166..1aabf7d3e62 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -498,7 +498,7 @@ private:
/// FunctionDecl object to save an allocation like FunctionType does.
ParmVarDecl **ParamInfo;
- LazyStmtPtr Body;
+ LazyDeclStmtPtr Body;
/// PreviousDeclaration - A link to the previous declaration of this
/// same function, NULL if this is the first declaration. For
diff --git a/clang/include/clang/AST/ExternalASTSource.h b/clang/include/clang/AST/ExternalASTSource.h
index ef097709333..db8a97034fc 100644
--- a/clang/include/clang/AST/ExternalASTSource.h
+++ b/clang/include/clang/AST/ExternalASTSource.h
@@ -65,12 +65,13 @@ public:
/// building a new declaration.
virtual Decl *GetDecl(unsigned ID) = 0;
- /// \brief Resolve the offset of a statement into a statement.
+ /// \brief Resolve the offset of a statement in the decl stream into a
+ /// statement.
///
/// This operation will read a new statement from the external
/// source each time it is called, and is meant to be used via a
/// LazyOffsetPtr.
- virtual Stmt *GetStmt(uint64_t Offset) = 0;
+ virtual Stmt *GetDeclStmt(uint64_t Offset) = 0;
/// \brief Read all of the declarations lexically stored in a
/// declaration context.
@@ -176,7 +177,7 @@ public:
};
/// \brief A lazy pointer to a statement.
-typedef LazyOffsetPtr<Stmt, &ExternalASTSource::GetStmt> LazyStmtPtr;
+typedef LazyOffsetPtr<Stmt, &ExternalASTSource::GetDeclStmt> LazyDeclStmtPtr;
} // end namespace clang
diff --git a/clang/include/clang/Frontend/PCHReader.h b/clang/include/clang/Frontend/PCHReader.h
index b9edd8ff838..5e75f720614 100644
--- a/clang/include/clang/Frontend/PCHReader.h
+++ b/clang/include/clang/Frontend/PCHReader.h
@@ -288,8 +288,8 @@ public:
///
/// This operation will read a new statement from the external
/// source each time it is called, and is meant to be used via a
- /// LazyOffsetPtr.
- virtual Stmt *GetStmt(uint64_t Offset);
+ /// LazyOffsetPtr (which is used by Decls for the body of functions, etc).
+ virtual Stmt *GetDeclStmt(uint64_t Offset);
/// ReadBlockAbbrevs - Enter a subblock of the specified BlockID with the
/// specified cursor. Read the abbreviations that are at the top of the block
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 4ea1e05b887..4ec2a3a18aa 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -1331,7 +1331,12 @@ Decl *PCHReader::GetDecl(pch::DeclID ID) {
return DeclsLoaded[Index];
}
-Stmt *PCHReader::GetStmt(uint64_t Offset) {
+/// \brief Resolve the offset of a statement into a statement.
+///
+/// This operation will read a new statement from the external
+/// source each time it is called, and is meant to be used via a
+/// LazyOffsetPtr (which is used by Decls for the body of functions, etc).
+Stmt *PCHReader::GetDeclStmt(uint64_t Offset) {
// Keep track of where we are in the stream, then jump back there
// after reading this declaration.
SavedStreamPosition SavedPosition(Stream);
OpenPOWER on IntegriCloud