improve DeclStmt to be able to store SourceRange info correctly.
Set the start of DeclStmt range. Right now the end is meaningless
though.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48330 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaStmt.cpp b/Sema/SemaStmt.cpp
index fe62c8a..14b2fdf 100644
--- a/Sema/SemaStmt.cpp
+++ b/Sema/SemaStmt.cpp
@@ -33,13 +33,13 @@
return new NullStmt(SemiLoc);
}
-Sema::StmtResult Sema::ActOnDeclStmt(DeclTy *decl) {
- if (decl) {
- ScopedDecl *SD = dyn_cast<ScopedDecl>(static_cast<Decl *>(decl));
- assert(SD && "Sema::ActOnDeclStmt(): expected ScopedDecl");
- return new DeclStmt(SD);
- } else
- return true; // error
+Sema::StmtResult Sema::ActOnDeclStmt(DeclTy *decl, SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ if (decl == 0)
+ return true;
+
+ ScopedDecl *SD = cast<ScopedDecl>(static_cast<Decl *>(decl));
+ return new DeclStmt(SD, StartLoc, EndLoc);
}
Action::StmtResult