aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-12 20:13:14 +0000
committerChris Lattner <sabre@nondot.org>2009-04-12 20:13:14 +0000
commit20401698e3bd93a24bb5d9e18e435895cefe5fd1 (patch)
treec1bd8cb429c2fdbdf9e288a249900d02e660ce17 /lib/Sema/SemaStmt.cpp
parentbfc861e703895cc6d1ec2403dfebf68b90ae0992 (diff)
add a new isNull() method to DeclGroupRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index d2e158658c..1428c48847 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -40,10 +40,11 @@ Sema::OwningStmtResult Sema::ActOnNullStmt(SourceLocation SemiLoc) {
Sema::OwningStmtResult Sema::ActOnDeclStmt(DeclGroupPtrTy dg,
SourceLocation StartLoc,
SourceLocation EndLoc) {
+ DeclGroupRef DG = dg.getAsVal<DeclGroupRef>();
+
// If we have an invalid decl, just return an error.
- if (!dg) return StmtError();
+ if (DG.isNull()) return StmtError();
- DeclGroupRef DG = dg.getAsVal<DeclGroupRef>();
return Owned(new (Context) DeclStmt(DG, StartLoc, EndLoc));
}