Daniel Dunbar [Thu, 30 Sep 2010 20:39:47 +0000 (20:39 +0000)]
c-index-test: Run inside a separate thread iff we have pthread support, to
ensure we at least get some minimal testing of running in a multithreaded
environment (for example, having a reduced stack size).
Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.
Support implicit includes when generating a PCH and allow the user to pass a -include on the command line following the PCH include.
Fixes rdar://7382084.
Marcin Swiderski [Thu, 30 Sep 2010 07:41:24 +0000 (07:41 +0000)]
Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.
Tom Care [Thu, 30 Sep 2010 01:12:05 +0000 (01:12 +0000)]
Updated scan-build:
- Idempotent operations are on by default, to match --analyze in the driver.
- Integrated stats calculation based on parsing warnings emitted with the -analyzer-stats flag. The new -stats flag enables this.
- New -maxloop flag to pass down a maxloop value to the analyzer.
Change CheckerVisitor so that [Pre,Post]VisitCallExpr only handles CallExprs for simple C functions, not
all CallExprs (including CXXMemberCallExpr, etc.). Now the generic handler for all CallExprs is [Pre,Post]VisitGenericCallExpr.
Also add [Pre,Post]Visit hooks for CXXMemberCallExpr.
Change GRExprEngine::VisitCXXMemberCallExpr() to do pre/post checker visits of the call.
Tom Care [Wed, 29 Sep 2010 23:48:34 +0000 (23:48 +0000)]
AnalyzerStatsChecker improvements:
- Use BlockEntrance rather than BlockEdge to bring in line with UnreachableCodeChecker. Fixes an issue where unreached blocks would still be counted as reachable.
- Added warnings for all BlockAborted locations. This allows us to see where the analyzer stopped analyzing.
Douglas Gregor [Wed, 29 Sep 2010 21:14:36 +0000 (21:14 +0000)]
When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.
Douglas Gregor [Wed, 29 Sep 2010 04:25:11 +0000 (04:25 +0000)]
Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.
Douglas Gregor [Wed, 29 Sep 2010 00:15:42 +0000 (00:15 +0000)]
Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.
Douglas Gregor [Tue, 28 Sep 2010 20:38:10 +0000 (20:38 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.
This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.
Sebastian Redl [Tue, 28 Sep 2010 20:23:00 +0000 (20:23 +0000)]
Move ExternalSemaSource::ReadMethodPool's implementation to Sema.cpp so that the header can get away with forward declarations only for ObjCMethodList and Selector. Fixes <rdar://8467631>.
Douglas Gregor [Tue, 28 Sep 2010 19:45:33 +0000 (19:45 +0000)]
Reinstate r114921, which I've exonerated via a self-host build.
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.
Douglas Gregor [Tue, 28 Sep 2010 17:48:56 +0000 (17:48 +0000)]
When we have two identifiers in a row in Objective-C, make sure to
verify that we aren't in a message-send expression before digging into
the identifier or looking ahead more tokens. Fixes a regression
(<rdar://problem/8483253>) I introduced with bracket insertion.
svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
Douglas Gregor [Tue, 28 Sep 2010 00:00:00 +0000 (00:00 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).
Douglas Gregor [Mon, 27 Sep 2010 23:39:06 +0000 (23:39 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.
Douglas Gregor [Mon, 27 Sep 2010 23:16:44 +0000 (23:16 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.
Douglas Gregor [Mon, 27 Sep 2010 22:48:58 +0000 (22:48 +0000)]
Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.
Douglas Gregor [Mon, 27 Sep 2010 22:37:28 +0000 (22:37 +0000)]
Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.
Douglas Gregor [Mon, 27 Sep 2010 22:06:20 +0000 (22:06 +0000)]
Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.
Bill Wendling [Mon, 27 Sep 2010 21:22:25 +0000 (21:22 +0000)]
Revert my patch changing the MMX "shift" intrinsics that take immediates into
"shift with non-immediate" intrinsics. It gets here because we they aren't
immediates anymore.
Douglas Gregor [Mon, 27 Sep 2010 21:17:54 +0000 (21:17 +0000)]
Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().
This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.
Issue warning for trivial cases of nonnull attributes
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro
instantiation in a header file. Fixes first part
of radar 6857843.
Marcin Swiderski [Sat, 25 Sep 2010 11:05:21 +0000 (11:05 +0000)]
In preparation for adding generation of destructors for objects with automatic storage added:
- LocalScope class with iterator used to pointing into it,
- fat doxygen comment for LocalScope indended usage,
- BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose.
Fix a NYI in IRGen which was due to incorrect AST
for property reference expression (of c++ object type)
in the conditional expression. Fixes // rdar://8291337
Douglas Gregor [Fri, 24 Sep 2010 23:29:12 +0000 (23:29 +0000)]
When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.
Also, add a little environment-variable-sensitive logging for
libclang.
Douglas Gregor [Fri, 24 Sep 2010 21:18:36 +0000 (21:18 +0000)]
Teach libclang to enable multithreading in LLVM, since libclang clients are likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients
Default synthesized ivars don't really have a location in the source. Using the location of the @implementation
is just confusing for clients that want to use SourceLocations for syntactic references.
Douglas Gregor [Thu, 23 Sep 2010 23:01:17 +0000 (23:01 +0000)]
Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.
Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.
For properties declared in a @protocol and redeclared in a class extension, use the class extension
as the lexical DeclContext for the @property declaration that gets auto-created for the @interface.