]> granicus.if.org Git - clang/commit
Document that GetTypeForDeclarator() cannot return a null type.
authorNico Weber <nicolasweber@gmx.de>
Sun, 4 Jan 2015 05:29:21 +0000 (05:29 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sun, 4 Jan 2015 05:29:21 +0000 (05:29 +0000)
commitdb67015f2d1d24986f2555263cd37659b287b025
tree96a85e127b6f3b584838c9fd093cd4cf7f866487
parenta17629290b6157dad843001e1cdeb4fe353f2e0f
Document that GetTypeForDeclarator() cannot return a null type.

Also add a few asserts for this.  The existing code assumes this in a bunch
of places already (see e.g. the assert at the top of ParseTypedefDecl(), and
there are many unchecked calls on the result of GetTypeForDeclarator()), and
from looking through the code this should always be true from what I can tell.
This allows removing ASTContext::getNullTypeSourceInfo() too as that's now
unused.

No behavior change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225125 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/Sema/SemaType.cpp