aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-07 17:02:32 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-07 17:02:32 +0000
commit225a2d946f73aed3b38f265fcb4e7d7d88136928 (patch)
tree5899280b760257254f33e522c231e796b74c22aa
parent2bd03923398add1bcb10d40c283cb0eb8ade74da (diff)
Implemented serialization of IndirectGotoStmt.
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43821 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--AST/StmtSerialization.cpp13
-rw-r--r--include/clang/AST/Stmt.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/AST/StmtSerialization.cpp b/AST/StmtSerialization.cpp
index e4a43acd33..e0b87c7cab 100644
--- a/AST/StmtSerialization.cpp
+++ b/AST/StmtSerialization.cpp
@@ -64,6 +64,9 @@ Stmt* Stmt::Materialize(llvm::Deserializer& D) {
case IfStmtClass:
return IfStmt::directMaterialize(D);
+ case IndirectGotoStmtClass:
+ return IndirectGotoStmt::directMaterialize(D);
+
case IntegerLiteralClass:
return IntegerLiteral::directMaterialize(D);
@@ -256,6 +259,16 @@ IfStmt* IfStmt::directMaterialize(llvm::Deserializer& D) {
return new IfStmt(L,Cond,Then,Else);
}
+void IndirectGotoStmt::directEmit(llvm::Serializer& S) const {
+ S.EmitPtr(Target);
+}
+
+IndirectGotoStmt* IndirectGotoStmt::directMaterialize(llvm::Deserializer& D) {
+ IndirectGotoStmt* stmt = new IndirectGotoStmt(NULL);
+ D.ReadPtr(stmt->Target); // The target may be backpatched.
+ return stmt;
+}
+
void IntegerLiteral::directEmit(llvm::Serializer& S) const {
S.Emit(Loc);
S.Emit(getType());
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index e35ca4671e..a7cfab0c83 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -602,6 +602,8 @@ public:
///
class IndirectGotoStmt : public Stmt {
Expr *Target;
+ // FIXME: Add location information (e.g. SourceLocation objects).
+ // When doing so, update the serialization routines.
public:
IndirectGotoStmt(Expr *target) : Stmt(IndirectGotoStmtClass), Target(target){}
@@ -618,6 +620,9 @@ public:
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
+
+ virtual void directEmit(llvm::Serializer& S) const;
+ static IndirectGotoStmt* directMaterialize(llvm::Deserializer& D);
};