summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/StmtSerialization.cpp2
-rw-r--r--clang/lib/Frontend/PCHReader.cpp1
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp1
-rw-r--r--clang/lib/Sema/SemaStmt.cpp4
4 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/AST/StmtSerialization.cpp b/clang/lib/AST/StmtSerialization.cpp
index 0d920fa23e3..7a37a16550d 100644
--- a/clang/lib/AST/StmtSerialization.cpp
+++ b/clang/lib/AST/StmtSerialization.cpp
@@ -691,7 +691,7 @@ void IndirectGotoStmt::EmitImpl(Serializer& S) const {
IndirectGotoStmt* IndirectGotoStmt::CreateImpl(Deserializer& D, ASTContext& C) {
Expr* Target = D.ReadOwnedPtr<Expr>(C);
- return new IndirectGotoStmt(Target);
+ return new IndirectGotoStmt(SourceLocation(), Target);
}
void InitListExpr::EmitImpl(Serializer& S) const {
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 6c79b8a5a57..9af75aef2b4 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -415,6 +415,7 @@ unsigned PCHStmtReader::VisitGotoStmt(GotoStmt *S) {
unsigned PCHStmtReader::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
VisitStmt(S);
+ S->setGotoLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
S->setTarget(cast_or_null<Expr>(StmtStack.back()));
return 1;
}
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index 1efe70f270f..9f22f13134b 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -610,6 +610,7 @@ void PCHStmtWriter::VisitGotoStmt(GotoStmt *S) {
void PCHStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
VisitStmt(S);
+ Writer.AddSourceLocation(S->getGotoLoc(), Record);
Writer.WriteSubStmt(S->getTarget());
Code = pch::STMT_INDIRECT_GOTO;
}
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 6595b881220..4a5facb39cc 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -666,7 +666,7 @@ Sema::ActOnGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc,
}
Action::OwningStmtResult
-Sema::ActOnIndirectGotoStmt(SourceLocation GotoLoc,SourceLocation StarLoc,
+Sema::ActOnIndirectGotoStmt(SourceLocation GotoLoc, SourceLocation StarLoc,
ExprArg DestExp) {
// Convert operand to void*
Expr* E = DestExp.takeAs<Expr>();
@@ -676,7 +676,7 @@ Sema::ActOnIndirectGotoStmt(SourceLocation GotoLoc,SourceLocation StarLoc,
if (DiagnoseAssignmentResult(ConvTy, StarLoc, Context.VoidPtrTy, ETy,
E, "passing"))
return StmtError();
- return Owned(new (Context) IndirectGotoStmt(E));
+ return Owned(new (Context) IndirectGotoStmt(GotoLoc, E));
}
Action::OwningStmtResult
OpenPOWER on IntegriCloud