]> granicus.if.org Git - clang/log
clang
13 years agoTake an entirely different approach to handling the "parsing" of
Douglas Gregor [Sat, 27 Aug 2011 06:37:51 +0000 (06:37 +0000)]
Take an entirely different approach to handling the "parsing" of
__import__ within the preprocessor, since the prior one foolishly
assumed that Preprocessor::Lex() was re-entrant. We now handle
__import__ at the top level (only), after macro expansion. This should
fix the buildbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138704 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Xfail the test for windows.
Argyrios Kyrtzidis [Sat, 27 Aug 2011 03:38:05 +0000 (03:38 +0000)]
[arcmt] Xfail the test for windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138696 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe lvalue-to-rvalue on structs in C++ is actually part
John McCall [Sat, 27 Aug 2011 01:09:30 +0000 (01:09 +0000)]
The lvalue-to-rvalue on structs in C++ is actually part
of default argument promotion and needs to happen unconditionally.
This is particularly semantically important in C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138691 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTwinify.
Benjamin Kramer [Sat, 27 Aug 2011 00:34:29 +0000 (00:34 +0000)]
Twinify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138689 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoXFAIL one of the module tests on win32, until we figure out what's happening
Douglas Gregor [Sat, 27 Aug 2011 00:29:32 +0000 (00:29 +0000)]
XFAIL one of the module tests on win32, until we figure out what's happening

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138688 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn C++0x mode, suggest nullptr as the initializer for an uninitialized
Douglas Gregor [Sat, 27 Aug 2011 00:18:50 +0000 (00:18 +0000)]
In C++0x mode, suggest nullptr as the initializer for an uninitialized
pointer variable. Patch by David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138687 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoControl 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid...
Ted Kremenek [Sat, 27 Aug 2011 00:16:45 +0000 (00:16 +0000)]
Control 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid-specifier) of -Wformat.  Fixes <rdar://problem/10031930>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138686 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove caret location for the GNU old-style field designator warning, from David...
Douglas Gregor [Sat, 27 Aug 2011 00:13:16 +0000 (00:13 +0000)]
Improve caret location for the GNU old-style field designator warning, from David Blaikie

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138684 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence a GCC warning
Douglas Gregor [Sat, 27 Aug 2011 00:10:53 +0000 (00:10 +0000)]
Silence a GCC warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138683 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the -import-module option. It's no longer useful
Douglas Gregor [Sat, 27 Aug 2011 00:03:05 +0000 (00:03 +0000)]
Remove the -import-module option. It's no longer useful

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138681 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry to unbreak the build on systems where uint64_t isn't something that StringRef...
Douglas Gregor [Fri, 26 Aug 2011 23:57:29 +0000 (23:57 +0000)]
Try to unbreak the build on systems where uint64_t isn't something that StringRef::getAsInteger can handle as its second argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138680 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce support for a simple module import declaration, which
Douglas Gregor [Fri, 26 Aug 2011 23:56:07 +0000 (23:56 +0000)]
Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
  - Module imports are handled first by the preprocessor (to get macro
  definitions) and then the same tokens are also handled by the parser
  (to get declarations). If both happen (as in normal compilation),
  the second one is redundant, because we currently have no way to
  hide macros or declarations when loading a module. Chris gets credit
  for this mad-but-workable scheme.
  - The Preprocessor now holds on to a reference to a module loader,
  which is responsible for loading named modules. CompilerInstance is
  the only important module loader: it now knows how to create and
  wire up an AST reader on demand to actually perform the module load.
  - We search for modules in the include path, using the module name
  with the suffix ".pcm" (precompiled module) for the file name. This
  is a temporary hack; we hope to improve the situation in the
  future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138679 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Add a test case for r138671 and improve the loop.
Argyrios Kyrtzidis [Fri, 26 Aug 2011 23:20:23 +0000 (23:20 +0000)]
[arcmt] Add a test case for r138671 and improve the loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138674 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFreeBSD (apparently) does not support crash-recovery tests.
Andrew Trick [Fri, 26 Aug 2011 22:46:31 +0000 (22:46 +0000)]
FreeBSD (apparently) does not support crash-recovery tests.

These tests have been failing since the beginning of buildbot time:
crash-recovery-code-complete.c
crash-recovery-reparse.c
crash-recovery.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138672 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Fix horrible bug where migrating files if there is a space in the paths
Argyrios Kyrtzidis [Fri, 26 Aug 2011 22:40:55 +0000 (22:40 +0000)]
[arcmt] Fix horrible bug where migrating files if there is a space in the paths
of the migrated files. rdar://10022801

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138671 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup r138662 per Ben and David's suggestions, thanks.
Chad Rosier [Fri, 26 Aug 2011 22:27:02 +0000 (22:27 +0000)]
Cleanup r138662 per Ben and David's suggestions, thanks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138670 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach the ASTReader how to avoid cycles when loading declarations that
Douglas Gregor [Fri, 26 Aug 2011 22:04:51 +0000 (22:04 +0000)]
Teach the ASTReader how to avoid cycles when loading declarations that
are lexically within a particular DeclContext. Test forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138668 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure the std::string isn't deallocated prior to use. Many thanks to Eli
Chad Rosier [Fri, 26 Aug 2011 21:47:20 +0000 (21:47 +0000)]
Make sure the std::string isn't deallocated prior to use.  Many thanks to Eli
for catching this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138666 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] When generating temporary files allow a prefix to be added. In many
Chad Rosier [Fri, 26 Aug 2011 21:28:44 +0000 (21:28 +0000)]
[driver] When generating temporary files allow a prefix to be added.  In many
cases we want the prefix to be the original file name less the suffix.  For an
input such as test.c to named temporary would be something like test-3O4Clq.o
Part of <rdar://problem/8314451>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138662 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen we're deserializing declarations lexically stored in a RecordDecl
Douglas Gregor [Fri, 26 Aug 2011 21:23:06 +0000 (21:23 +0000)]
When we're deserializing declarations lexically stored in a RecordDecl
after having already deserialized the fields, clear out the fields
first. This makes sure that we keep all of the declarations in the
lexical context (including those implicitly added by later
type-checking) within the same list. A test case for this behavior is
coming as part of another commit; testing for this problem in
isolation is a nightmare.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138661 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc-arc: Mention property's attribute by name when
Fariborz Jahanian [Fri, 26 Aug 2011 21:21:19 +0000 (21:21 +0000)]
objc-arc: Mention property's attribute by name when
finding life-time conflict with its declared ivar.
// rdar://10007230

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138659 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSlight optimization enabled by the previous assert:
John McCall [Fri, 26 Aug 2011 21:08:13 +0000 (21:08 +0000)]
Slight optimization enabled by the previous assert:
emit all gl-value arguments as reference bindings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138655 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove a couple of unnecessary returns after llvm_unreachables.
Jordy Rose [Fri, 26 Aug 2011 20:32:01 +0000 (20:32 +0000)]
[analyzer] Remove a couple of unnecessary returns after llvm_unreachables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138649 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't assert on taking the address of a non-type template parameter. Fixes PR10766.
Eli Friedman [Fri, 26 Aug 2011 20:28:17 +0000 (20:28 +0000)]
Don't assert on taking the address of a non-type template parameter.  Fixes PR10766.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138648 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure we don't crash printing builtin candidates for overloads of deleted operato...
Eli Friedman [Fri, 26 Aug 2011 19:46:22 +0000 (19:46 +0000)]
Make sure we don't crash printing builtin candidates for overloads of deleted operators.  Fixes PR10757.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138645 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAssert that a call argument is a gl-value iff the parameter is a reference type.
John McCall [Fri, 26 Aug 2011 18:42:59 +0000 (18:42 +0000)]
Assert that a call argument is a gl-value iff the parameter is a reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138639 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn -Wno-error=non-pod-varargs, initialize a temporary with
John McCall [Fri, 26 Aug 2011 18:41:18 +0000 (18:41 +0000)]
In -Wno-error=non-pod-varargs, initialize a temporary with
the crazy comma expression so that we get an r-value in the
varargs position.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138638 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Remove a few more options when clang invokes cc1plus for i386 kexts.
Chad Rosier [Fri, 26 Aug 2011 18:30:43 +0000 (18:30 +0000)]
[driver] Remove a few more options when clang invokes cc1plus for i386 kexts.
<rdar://problem/10027287>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138637 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFrom Vassil Vassilev: unnamed decls cannot be removed from the lookup map.
Axel Naumann [Fri, 26 Aug 2011 14:06:12 +0000 (14:06 +0000)]
From Vassil Vassilev: unnamed decls cannot be removed from the lookup map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138631 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhat say we document some of these AggValueSlot flags a bit
John McCall [Fri, 26 Aug 2011 08:02:37 +0000 (08:02 +0000)]
What say we document some of these AggValueSlot flags a bit
better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138628 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSince the 'is aliased' bit is critical for correctness in C++, it
John McCall [Fri, 26 Aug 2011 07:31:35 +0000 (07:31 +0000)]
Since the 'is aliased' bit is critical for correctness in C++, it
really shouldn't be optional.  Fix the remaining place where a
temporary was being passed as potentially-aliased memory.

Fixes PR10756.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138627 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAn initialization does not alias.
John McCall [Fri, 26 Aug 2011 05:38:08 +0000 (05:38 +0000)]
An initialization does not alias.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138624 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTake 2: Actually fix spacing.
Chad Rosier [Fri, 26 Aug 2011 00:49:52 +0000 (00:49 +0000)]
Take 2: Actually fix spacing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138617 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBe sure to do unary conversions on the operand to an ARC
John McCall [Fri, 26 Aug 2011 00:48:42 +0000 (00:48 +0000)]
Be sure to do unary conversions on the operand to an ARC
bridged cast.  Noticed by AST inspection by Ted Kremenek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138616 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe allocated exception slot does not alias anything; should fix self-host.
John McCall [Fri, 26 Aug 2011 00:46:38 +0000 (00:46 +0000)]
The allocated exception slot does not alias anything;  should fix self-host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138615 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago80-column.
Chad Rosier [Fri, 26 Aug 2011 00:44:04 +0000 (00:44 +0000)]
80-column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138614 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHandle CXXTempObjectRegion in StackAddrEscapeChecker.
Jeffrey Yasskin [Fri, 26 Aug 2011 00:41:31 +0000 (00:41 +0000)]
Handle CXXTempObjectRegion in StackAddrEscapeChecker.

Also convert stack-addr-ps.cpp to use the analyzer instead of just Sema, now
that it doesn't crash, and extract the stack-block test into another file since
it errors, and that prevents the analyzer from running.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138613 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Add -mglobal-merge/-mno-global-merge machine options to enable/disable mergi...
Chad Rosier [Fri, 26 Aug 2011 00:26:29 +0000 (00:26 +0000)]
[driver] Add -mglobal-merge/-mno-global-merge machine options to enable/disable merging of
globals during codegen.
Fixes <rdar://problem/10017909>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138612 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorevert 138610, accidental commit.
Francois Pichet [Fri, 26 Aug 2011 00:22:34 +0000 (00:22 +0000)]
revert 138610, accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138611 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agogit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138610 91177308-0d34-0410...
Francois Pichet [Fri, 26 Aug 2011 00:18:13 +0000 (00:18 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138610 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Increase the number of possible checks for a checker.
Jordy Rose [Fri, 26 Aug 2011 00:08:00 +0000 (00:08 +0000)]
[analyzer] Increase the number of possible checks for a checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138609 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update the test
Ivan Krasin [Thu, 25 Aug 2011 23:49:20 +0000 (23:49 +0000)]
PNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138607 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a crash-on-invalid.
Matt Beaumont-Gay [Thu, 25 Aug 2011 23:22:24 +0000 (23:22 +0000)]
Fix a crash-on-invalid.

Much to everyone's surprise, the default constructor for TypeResult produces
an instance with Invalid == false. This seems like a decision we may want to
revisit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138601 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTrack whether an AggValueSlot is potentially aliased, and do not
John McCall [Thu, 25 Aug 2011 23:04:34 +0000 (23:04 +0000)]
Track whether an AggValueSlot is potentially aliased, and do not
emit call results into potentially aliased slots.  This allows us
to properly mark indirect return slots as noalias, at the cost
of requiring an extra memcpy when assigning an aggregate call
result into a l-value.  It also brings us into compliance with
the x86-64 ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138599 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't warn on category implementing a method, if
Fariborz Jahanian [Thu, 25 Aug 2011 22:58:42 +0000 (22:58 +0000)]
Don't warn on category implementing a method, if
declated method in the class belongs to a synthesized
property getter/setter. // rdar://10014946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138598 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate the -chained-pch flag and all of the frontend and libclang options associat...
Douglas Gregor [Thu, 25 Aug 2011 22:54:01 +0000 (22:54 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138597 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the Chaining argument from the PCH/module generator. It's no longer used
Douglas Gregor [Thu, 25 Aug 2011 22:35:51 +0000 (22:35 +0000)]
Remove the Chaining argument from the PCH/module generator. It's no longer used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138596 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a -cc1 option "-emit-module", that creates a binary module
Douglas Gregor [Thu, 25 Aug 2011 22:30:56 +0000 (22:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138595 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - fix a bug exposed by my recent decl context
Fariborz Jahanian [Thu, 25 Aug 2011 22:26:53 +0000 (22:26 +0000)]
objc - fix a bug exposed by my recent decl context
changes. // rdar://10015110

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138594 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] Fix getting a cursor that points inside tag definition that is part
Argyrios Kyrtzidis [Thu, 25 Aug 2011 22:24:47 +0000 (22:24 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138593 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up the reloading of identifier information following the load of
Douglas Gregor [Thu, 25 Aug 2011 21:19:59 +0000 (21:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138586 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPreload source location entries as soon as we've loaded a particular
Douglas Gregor [Thu, 25 Aug 2011 21:09:44 +0000 (21:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138585 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReverse r138567 until a buildbot failure is investigated.
Fariborz Jahanian [Thu, 25 Aug 2011 21:09:22 +0000 (21:09 +0000)]
Reverse r138567 until a buildbot failure is investigated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138584 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove file validation in the ASTReader from "top of chain" validation
Douglas Gregor [Thu, 25 Aug 2011 20:58:51 +0000 (20:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138583 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFactor the Module and ModuleManager classes out into separate headers
Douglas Gregor [Thu, 25 Aug 2011 20:47:51 +0000 (20:47 +0000)]
Factor the Module and ModuleManager classes out into separate headers
and .cpp files, since ASTReader.cpp was getting way too large. No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138582 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse stronger typing for the flags on AggValueSlot and require
John McCall [Thu, 25 Aug 2011 20:40:09 +0000 (20:40 +0000)]
Use stronger typing for the flags on AggValueSlot and require
creators to tell us whether something needs GC barriers.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138581 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may be
Argyrios Kyrtzidis [Thu, 25 Aug 2011 20:39:19 +0000 (20:39 +0000)]
Make Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may be
out-of-sync how a file is compiled. Patch by Matthias Kleine!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138580 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago80-column and spacing.
Chad Rosier [Thu, 25 Aug 2011 20:17:19 +0000 (20:17 +0000)]
80-column and spacing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138578 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach -Wunreachable-code about dead code caused by macro expansions. This should...
Ted Kremenek [Thu, 25 Aug 2011 19:28:55 +0000 (19:28 +0000)]
Teach -Wunreachable-code about dead code caused by macro expansions.  This should suppress false positives resulting from 'assert' and friends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138576 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch ASTReader::GetHeaderFileInfo() from a walk over the module
Douglas Gregor [Thu, 25 Aug 2011 18:14:34 +0000 (18:14 +0000)]
Switch ASTReader::GetHeaderFileInfo() from a walk over the module
chain to a proper search.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138574 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch the forward walk through the module chain over to a depth-first
Douglas Gregor [Thu, 25 Aug 2011 18:03:05 +0000 (18:03 +0000)]
Switch the forward walk through the module chain over to a depth-first
search in ASTReader::ReadPreprocessedEntities().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138572 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixes a typo in my last patch.
Fariborz Jahanian [Thu, 25 Aug 2011 18:01:27 +0000 (18:01 +0000)]
Fixes a typo in my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138571 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc -arse: Use DeclGroup for forward class declarations;
Fariborz Jahanian [Thu, 25 Aug 2011 17:47:31 +0000 (17:47 +0000)]
objc -arse: Use DeclGroup for forward class declarations;
as in @class foo, bar. More cleanup to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138567 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Do not add -kext to the link command line when compiling with
Chad Rosier [Thu, 25 Aug 2011 17:33:03 +0000 (17:33 +0000)]
[driver] Do not add -kext to the link command line when compiling with
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138564 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove a bogus assertion from the AST reader, which assumed that
Douglas Gregor [Thu, 25 Aug 2011 15:28:26 +0000 (15:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138557 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse the module manager's search facility to look for methods with a
Douglas Gregor [Thu, 25 Aug 2011 14:51:20 +0000 (14:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138556 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with a level...
Jordy Rose [Thu, 25 Aug 2011 01:14:38 +0000 (01:14 +0000)]
[analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with a level of indirection to handle GC vs. non-GC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138538 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.
Anna Zaks [Thu, 25 Aug 2011 00:59:06 +0000 (00:59 +0000)]
[analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138535 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for Microsoft __ptr32 keyword.
Francois Pichet [Thu, 25 Aug 2011 00:36:46 +0000 (00:36 +0000)]
Add support for Microsoft __ptr32 keyword.
Patch by Chris Cudmore!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138533 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.
Jordy Rose [Thu, 25 Aug 2011 00:34:03 +0000 (00:34 +0000)]
[analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.

(These bug types may have just been leaked before...!)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138532 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Add the custom BugReport visitor(which highlights...
Anna Zaks [Thu, 25 Aug 2011 00:32:42 +0000 (00:32 +0000)]
[analyzer] MacOSKeychainAPIChecker: Add the custom BugReport visitor(which highlights the allocation site) to all the relevant reports within the checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138531 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move the RetainSummaryManager from CFRefCount to RetainReleaseChecker.
Jordy Rose [Thu, 25 Aug 2011 00:10:37 +0000 (00:10 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138529 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoblocks - capturing logic of byref block variable's expression
Fariborz Jahanian [Thu, 25 Aug 2011 00:06:26 +0000 (00:06 +0000)]
blocks - capturing logic of byref block variable's expression
statement initializer makes safe assumption when a substatement
is encounterred (with a fix me).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138528 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Better fix for the "missing return" error, from Ted.
Jordy Rose [Wed, 24 Aug 2011 23:41:46 +0000 (23:41 +0000)]
[analyzer] Better fix for the "missing return" error, from Ted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138526 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Silence another incorrect warning ("control reaches end of non-void function")
Jordy Rose [Wed, 24 Aug 2011 22:58:49 +0000 (22:58 +0000)]
[analyzer] Silence another incorrect warning ("control reaches end of non-void function")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138510 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove experimental FIXME that never actually applied to the code in trunk.
Jordy Rose [Wed, 24 Aug 2011 22:45:12 +0000 (22:45 +0000)]
[analyzer] Remove experimental FIXME that never actually applied to the code in trunk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138508 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] CFRefReport and friends no longer depend on CFRefCount.
Jordy Rose [Wed, 24 Aug 2011 22:39:09 +0000 (22:39 +0000)]
[analyzer] CFRefReport and friends no longer depend on CFRefCount.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138506 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove long-dead FIXME
Douglas Gregor [Wed, 24 Aug 2011 22:09:40 +0000 (22:09 +0000)]
Remove long-dead FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138498 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Do not use references in std::pair.
Anna Zaks [Wed, 24 Aug 2011 21:58:55 +0000 (21:58 +0000)]
[analyzer] Do not use references in std::pair.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138497 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't force the complete deserialization of the visible-declarations
Douglas Gregor [Wed, 24 Aug 2011 21:56:08 +0000 (21:56 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138496 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Unbreak the release buildbot.
Anna Zaks [Wed, 24 Aug 2011 21:40:10 +0000 (21:40 +0000)]
[analyzer] Unbreak the release buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138493 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a depth-first search of modules into the module manager,
Douglas Gregor [Wed, 24 Aug 2011 21:27:34 +0000 (21:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138490 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFollow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.
Ivan Krasin [Wed, 24 Aug 2011 21:22:25 +0000 (21:22 +0000)]
Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138489 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace by pointing...
Anna Zaks [Wed, 24 Aug 2011 20:52:46 +0000 (20:52 +0000)]
[analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace by pointing to the allocation site when reporting a leak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138479 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron.
Jordy Rose [Wed, 24 Aug 2011 20:38:42 +0000 (20:38 +0000)]
[analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138477 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Copy GC mode setting from CFRefCount to RetainReleaseChecker in preparatio...
Jordy Rose [Wed, 24 Aug 2011 20:33:55 +0000 (20:33 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138476 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence 'may be used uninitialized' warnings.
Argyrios Kyrtzidis [Wed, 24 Aug 2011 20:33:05 +0000 (20:33 +0000)]
Silence 'may be used uninitialized' warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138475 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Allow checker writes to specify that no region should be accosiated with...
Anna Zaks [Wed, 24 Aug 2011 20:31:06 +0000 (20:31 +0000)]
[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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138474 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd PNaCl TargetInfo.
Ivan Krasin [Wed, 24 Aug 2011 20:22:22 +0000 (20:22 +0000)]
Add PNaCl TargetInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138470 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove unused DoNothingByRef and the special case for CFDictionaryCreate.
Jordy Rose [Wed, 24 Aug 2011 19:10:50 +0000 (19:10 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138464 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn the AST reader, switch name lookup within a DeclContect over to the
Douglas Gregor [Wed, 24 Aug 2011 19:03:07 +0000 (19:03 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138463 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Slightly clean up the fix in 138432, so that it doesn't depend on the...
Jordy Rose [Wed, 24 Aug 2011 18:56:32 +0000 (18:56 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138462 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: Fix a few typos in last commit -- use LockID instead of Lock in commen...
Caitlin Sadowski [Wed, 24 Aug 2011 18:46:20 +0000 (18:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138460 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMatch LLVM change: TargetRegistry and TargetSelect have been moved to Support.
Evan Cheng [Wed, 24 Aug 2011 18:09:14 +0000 (18:09 +0000)]
Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138451 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReset FirstID (first diagnostic's file ID) to allow for invocations of the VerifyDiag...
Axel Naumann [Wed, 24 Aug 2011 13:36:19 +0000 (13:36 +0000)]
Reset FirstID (first diagnostic's file ID) to allow for invocations of the VerifyDiagnosticsClient on several input files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138434 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a Heisenbug concerning object lifetimes with a hack. Hopefully a bette...
Jordy Rose [Wed, 24 Aug 2011 09:27:24 +0000 (09:27 +0000)]
[analyzer] Fix a Heisenbug concerning object lifetimes with a hack. Hopefully a better fix coming soon. See comment for more details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138432 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", reverted in 138405...
Jordy Rose [Wed, 24 Aug 2011 09:22:31 +0000 (09:22 +0000)]
[analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", reverted in 138405. Ended up unrelated to any problems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138431 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix potential crasher with RAII. No functionality change. (No test because...
Jordy Rose [Wed, 24 Aug 2011 09:02:37 +0000 (09:02 +0000)]
[analyzer] Fix potential crasher with RAII. No functionality change. (No test because this particular circumstance requires an impossible series of events, but this is future-proofing.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138430 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420). The issue seems...
Jordy Rose [Wed, 24 Aug 2011 05:47:39 +0000 (05:47 +0000)]
[analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420). The issue seems to have been with the uninitialized variable fixed in 138424; a fix for another Heisencrasher coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138426 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Correctly initialize a variable and hopefully fix crashes.
Jordy Rose [Wed, 24 Aug 2011 04:48:19 +0000 (04:48 +0000)]
[analyzer] Correctly initialize a variable and hopefully fix crashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138424 91177308-0d34-0410-b5e6-96231b3b80d8