]> granicus.if.org Git - clang/commit
Split RequireCompleteType into a function that actually requires that the type
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Dec 2015 22:40:25 +0000 (22:40 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Dec 2015 22:40:25 +0000 (22:40 +0000)
commit5dbd903a7e109d970f48ae9f5baa76eed52e72fd
tree545f0159a18a92a11c61a897889df503300bc6b5
parentbef33a25fe5cdc48025d3a29591e6ac784989b2f
Split RequireCompleteType into a function that actually requires that the type
is complete (with an error produced if not) and a function that merely queries
whether the type is complete. Either way we'll trigger instantiation if
necessary, but only the former will diagnose and recover from missing module
imports.

The intent of this change is to prevent a class of bugs where code would call
RequireCompleteType(..., 0) and then ignore the result. With modules, we must
check the return value and use it to determine whether the definition of the
type is visible.

This also fixes a debug info quality issue: calls to isCompleteType do not
trigger the emission of debug information for a type in limited-debug-info
mode. This allows us to avoid emitting debug information for type definitions
in more cases where we believe it is safe to do so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256049 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/clang/Sema/Sema.h
lib/Sema/SemaCast.cpp
lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaExprObjC.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaOverload.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/SemaStmtAsm.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateDeduction.cpp
lib/Sema/SemaType.cpp
test/CodeGenCXX/debug-info-limited.cpp