Commit Graph

32095 Commits

Author SHA1 Message Date
Fariborz Jahanian 5cc730cdef Don't warn on category implementing a method, if
declated method in the class belongs to a synthesized
property getter/setter. // rdar://10014946

llvm-svn: 138598
2011-08-25 22:58:42 +00:00
Douglas Gregor 2ed0ee1ace Eliminate the -chained-pch flag and all of the frontend and libclang options associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file
llvm-svn: 138597
2011-08-25 22:54:01 +00:00
Douglas Gregor 36db4f9602 Remove the Chaining argument from the PCH/module generator. It's no longer used
llvm-svn: 138596
2011-08-25 22:35:51 +00:00
Douglas Gregor 69f74f80db Introduce a -cc1 option "-emit-module", that creates a binary module
from the given source. -emit-module behaves similarly to -emit-pch,
except that Sema is somewhat more strict about the contents of
-emit-module. In the future, there are likely to be more interesting
differences.

llvm-svn: 138595
2011-08-25 22:30:56 +00:00
Fariborz Jahanian 371376010f objc - fix a bug exposed by my recent decl context
changes. // rdar://10015110

llvm-svn: 138594
2011-08-25 22:26:53 +00:00
Argyrios Kyrtzidis 440f954d6f [libclang] Fix getting a cursor that points inside tag definition that is part
of a type specifier.

e.g. for:

typedef struct _MyS {
  int foo;
} MyS;

pointing at field 'foo' would give a cursor for the typedef declaration 'MyS'
instead of the field.

llvm-svn: 138593
2011-08-25 22:24:47 +00:00
Douglas Gregor d09937fde0 Clean up the reloading of identifier information following the load of
a top-level module. This code is still horrible and should go away,
but we're not there yet.

llvm-svn: 138586
2011-08-25 21:19:59 +00:00
Douglas Gregor a918babff4 Preload source location entries as soon as we've loaded a particular
AST file, rather than waiting until we finish loading the top-level
AST file.

llvm-svn: 138585
2011-08-25 21:09:44 +00:00
Fariborz Jahanian d8114f7560 Reverse r138567 until a buildbot failure is investigated.
llvm-svn: 138584
2011-08-25 21:09:22 +00:00
Douglas Gregor 2fdb6b5391 Move file validation in the ASTReader from "top of chain" validation
to "when loading a particular module" validation, since it was only
validating local information anyway. This shouldn't change anything.

llvm-svn: 138583
2011-08-25 20:58:51 +00:00
Douglas Gregor d44252ec03 Factor the Module and ModuleManager classes out into separate headers
and .cpp files, since ASTReader.cpp was getting way too large. No
functionality change.

llvm-svn: 138582
2011-08-25 20:47:51 +00:00
John McCall 8d6fc9583d Use stronger typing for the flags on AggValueSlot and require
creators to tell us whether something needs GC barriers.
No functionality change.

llvm-svn: 138581
2011-08-25 20:40:09 +00:00
Argyrios Kyrtzidis 7aecbc7661 Make Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may be
out-of-sync how a file is compiled. Patch by Matthias Kleine!

llvm-svn: 138580
2011-08-25 20:39:19 +00:00
Chad Rosier 9c286cce2e 80-column and spacing.
llvm-svn: 138578
2011-08-25 20:17:19 +00:00
Ted Kremenek 1b7f49c2d6 Teach -Wunreachable-code about dead code caused by macro expansions. This should suppress false positives resulting from 'assert' and friends.
llvm-svn: 138576
2011-08-25 19:28:55 +00:00
Douglas Gregor 69e9464340 Switch ASTReader::GetHeaderFileInfo() from a walk over the module
chain to a proper search.

llvm-svn: 138574
2011-08-25 18:14:34 +00:00
Douglas Gregor 14f771695a Switch the forward walk through the module chain over to a depth-first
search in ASTReader::ReadPreprocessedEntities().

llvm-svn: 138572
2011-08-25 18:03:05 +00:00
Fariborz Jahanian 35d0e66bee Fixes a typo in my last patch.
llvm-svn: 138571
2011-08-25 18:01:27 +00:00
Fariborz Jahanian 73d5f67f5a objc -arse: Use DeclGroup for forward class declarations;
as in @class foo, bar. More cleanup to follow.

llvm-svn: 138567
2011-08-25 17:47:31 +00:00
Chad Rosier 160276dc93 [driver] Do not add -kext to the link command line when compiling with
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.

llvm-svn: 138564
2011-08-25 17:33:03 +00:00
Douglas Gregor aa7cbfd259 Remove a bogus assertion from the AST reader, which assumed that
redeclarations of a particular entity would occur in source
order. Friend declarations that occur within class templates (or
member classes thereof) do not follow this, nor would modules. Big
thanks to Erik Verbruggen for reducing this problem from the Very
Large Qt preamble testcase he found.

llvm-svn: 138557
2011-08-25 15:28:26 +00:00
Douglas Gregor c10edd6dd0 Use the module manager's search facility to look for methods with a
given selector, rather than walking the chain backwards. Teach its
visitor how to merge multiple result sets into a single result set,
combining the results of selector lookup in several different modules
into a single result set.

llvm-svn: 138556
2011-08-25 14:51:20 +00:00
Jordy Rose 15484daafe [analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with a level of indirection to handle GC vs. non-GC.
llvm-svn: 138538
2011-08-25 01:14:38 +00:00
Anna Zaks 5be8a4d104 [analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.
llvm-svn: 138535
2011-08-25 00:59:06 +00:00
Francois Pichet f2fb411d4a Add support for Microsoft __ptr32 keyword.
Patch by Chris Cudmore!

llvm-svn: 138533
2011-08-25 00:36:46 +00:00
Jordy Rose 4ba0ba42e2 [analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.
(These bug types may have just been leaked before...!)

llvm-svn: 138532
2011-08-25 00:34:03 +00:00
Anna Zaks 85913db489 [analyzer] MacOSKeychainAPIChecker: Add the custom BugReport visitor(which highlights the allocation site) to all the relevant reports within the checker.
llvm-svn: 138531
2011-08-25 00:32:42 +00:00
Jordy Rose 8b289a2cbd [analyzer] Move the RetainSummaryManager from CFRefCount to RetainReleaseChecker.
Because Checkers live for an entire translation unit, this persists summary caches across multiple code bodies and avoids repeated initialization (but probably at the cost of memory). This removes the last references from RetainReleaseChecker to CFRefCount.

llvm-svn: 138529
2011-08-25 00:10:37 +00:00
Fariborz Jahanian 5c4b2ca699 blocks - capturing logic of byref block variable's expression
statement initializer makes safe assumption when a substatement 
is encounterred (with a fix me).

llvm-svn: 138528
2011-08-25 00:06:26 +00:00
Jordy Rose a4c41bb875 [analyzer] Better fix for the "missing return" error, from Ted.
llvm-svn: 138526
2011-08-24 23:41:46 +00:00
Jordy Rose 34a83e911f [analyzer] Silence another incorrect warning ("control reaches end of non-void function")
llvm-svn: 138510
2011-08-24 22:58:49 +00:00
Jordy Rose 763982b82d [analyzer] Remove experimental FIXME that never actually applied to the code in trunk.
llvm-svn: 138508
2011-08-24 22:45:12 +00:00
Jordy Rose 184bd1430b [analyzer] CFRefReport and friends no longer depend on CFRefCount.
llvm-svn: 138506
2011-08-24 22:39:09 +00:00
Douglas Gregor 754ff8b622 Remove long-dead FIXME
llvm-svn: 138498
2011-08-24 22:09:40 +00:00
Anna Zaks f880cff209 [analyzer] Do not use references in std::pair.
llvm-svn: 138497
2011-08-24 21:58:55 +00:00
Douglas Gregor a3e59b49e7 Don't force the complete deserialization of the visible-declarations
table when serializing an AST file. This was a holdover from the days
before chained PCH, and is a complete waste of time and storage
now. It's a good thing it's useless, because I have no idea how I
would have implemented MaterializeVisibleDecls efficiently in the
presence of modules.

llvm-svn: 138496
2011-08-24 21:56:08 +00:00
Anna Zaks 0d67579497 [analyzer] Unbreak the release buildbot.
llvm-svn: 138493
2011-08-24 21:40:10 +00:00
Douglas Gregor 1257f97003 Introduce a depth-first search of modules into the module manager,
which supports both pre-order and post-order traversal via a visitor
mechanism. Use this depth-first search with a post-order traversal to
give predictable ordering semantics when walking all of the lexical
declarations in the translation unit.

Eventually, module imports will occur in the source code rather than
at the beginning, and we'll have to revisit this walk.

llvm-svn: 138490
2011-08-24 21:27:34 +00:00
Ivan Krasin 7a09d12242 Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.
llvm-svn: 138489
2011-08-24 21:22:25 +00:00
Anna Zaks be460898bb [analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace by pointing to the allocation site when reporting a leak.
llvm-svn: 138479
2011-08-24 20:52:46 +00:00
Jordy Rose 9ff0299935 [analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron.
llvm-svn: 138477
2011-08-24 20:38:42 +00:00
Jordy Rose 38eea65acd [analyzer] Copy GC mode setting from CFRefCount to RetainReleaseChecker in preparation for getting rid of CFRefCount.
This is a little hacky for now but will get better once we decide the best way to handle this.

llvm-svn: 138476
2011-08-24 20:33:55 +00:00
Argyrios Kyrtzidis b87ea9871d Silence 'may be used uninitialized' warnings.
llvm-svn: 138475
2011-08-24 20:33:05 +00:00
Anna Zaks 45aa208554 [analyzer] Allow checker writes to specify that no region should be accosiated with the report. (Useful when we report an error on endOfPath or deadSymbols, when the range of the last expression might have nothing to do with the error.)
llvm-svn: 138474
2011-08-24 20:31:06 +00:00
Ivan Krasin dd7403e612 Add PNaCl TargetInfo.
llvm-svn: 138470
2011-08-24 20:22:22 +00:00
Jordy Rose e8743a7499 [analyzer] Remove unused DoNothingByRef and the special case for CFDictionaryCreate.
This is a very small regression (actually introduced in r138309) because it won't catch leaks of objects passed by reference to CFDictionaryCreate (they're considered to have escaped and are ignored). If this is important we can put in a specific eval::Call to restore the functionality.

llvm-svn: 138464
2011-08-24 19:10:50 +00:00
Douglas Gregor 94619c81fc In the AST reader, switch name lookup within a DeclContect over to the
module DAG-based lookup scheme. This required some reshuffling, so
that each module stores its own mapping from DeclContexts to their
lexical and visible sets for those DeclContexts (rather than one big
"chain"). 

Overall, this allows simple qualified name lookup into the translation
unit to gather results from multiple modules, with the lookup results
in module B shadowing the lookup results in module A when B imports A.

Walking all of the lexical declarations in a module DAG is still a
mess; we'll end up walking the loaded module list backwards, which
works fine for chained PCH but doesn't make sense in a DAG. I'll
tackle this issue as a separate commit.

llvm-svn: 138463
2011-08-24 19:03:07 +00:00
Jordy Rose 5df640dc33 [analyzer] Slightly clean up the fix in 138432, so that it doesn't depend on the relative ordering of path-sensitive and path-insensitive checks. Still not ideal, but I think a real fix would require infrastructure that doesn't exist yet.
llvm-svn: 138462
2011-08-24 18:56:32 +00:00
Caitlin Sadowski 726003e79d Thread safety: Fix a few typos in last commit -- use LockID instead of Lock in comments and start a couple methods with a lowercase letter
llvm-svn: 138460
2011-08-24 18:46:20 +00:00
Evan Cheng 494eb062b5 Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.
llvm-svn: 138451
2011-08-24 18:09:14 +00:00