Fariborz Jahanian [Wed, 1 May 2013 17:28:37 +0000 (17:28 +0000)]
[ObjC declaration documentation] declaration of
types involving Objective-C pointers must have
their arc qualifiers elided as they don't
add any additional info. // rdar://
13757500.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180860
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 1 May 2013 15:16:52 +0000 (15:16 +0000)]
As of r180836, these tests should no longer be XFAILed on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180853
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 1 May 2013 00:24:09 +0000 (00:24 +0000)]
Point diagnostics that complain about a use of a selector in an objc message, to the selector location.
Previously it would point to the left bracket or the receiver, which can be particularly
problematic if the receiver is a block literal and we end up point the diagnostic far away
for the selector that is complaining about.
rdar://
13620447
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180833
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 30 Apr 2013 22:45:09 +0000 (22:45 +0000)]
Revert 180817 because 180816 was reverted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180823
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 30 Apr 2013 22:43:51 +0000 (22:43 +0000)]
Fix PR15845: apparently MSVC does not support implicit int in C++ mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180822
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 30 Apr 2013 22:17:36 +0000 (22:17 +0000)]
Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.
(Paired commit with LLVM: r180815)
rdar://problem/
13658587
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180817
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 30 Apr 2013 22:01:21 +0000 (22:01 +0000)]
[driver] Allow multiple -arch options with -save-temps by adding the arch name
to the temporary files.
rdar://
13218604
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180813
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Tue, 30 Apr 2013 22:00:04 +0000 (22:00 +0000)]
[analyzer] scan-build: support -enable-checker with new Xcode integration.
<rdar://problem/
13772094>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180812
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 30 Apr 2013 21:34:13 +0000 (21:34 +0000)]
Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin systems and did not do the right thing on Darwin.
Original commit message:
Emit the TLS intialization functions into a list.
Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'
<rdar://problem/
13733006>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180809
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 30 Apr 2013 21:23:01 +0000 (21:23 +0000)]
When deducing an 'auto' type, don't modify the type-as-written.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180808
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 30 Apr 2013 20:15:14 +0000 (20:15 +0000)]
[ms-cxxabi] Implement member pointer comparisons
Summary:
Like Itanium, comparisons are basically bitwise comparisons of the two
values, with an exception for null member function pointers. If two
function pointers are null, only the function pointer field matters for
comparison purposes. The rest of the bits can be arbitrary. We take
advantage of this in isZeroInitializable(), and it may matter once we
start emitting conversions.
Reviewers: rjmccall
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D695
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180800
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 30 Apr 2013 17:38:09 +0000 (17:38 +0000)]
Struct-path aware TBAA: enable struct-path aware TBAA for classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180795
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 30 Apr 2013 13:56:41 +0000 (13:56 +0000)]
Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 30 Apr 2013 13:08:15 +0000 (13:08 +0000)]
Use {{.*}}suffix instead of [[TC]] in places where we print the toolchain
path with /. This matches linux-ld.c and should finish fixing this test on
windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180786
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 30 Apr 2013 12:24:40 +0000 (12:24 +0000)]
Always use / when computing mips specific paths.
We were getting paths with both / and \ in them. This should fix mips-cs-ld.c
on the windows bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180783
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Tue, 30 Apr 2013 07:47:13 +0000 (07:47 +0000)]
[Mips] Pass -mips16, -mmicromips, -mdsp and -mdspr2 flags to the
assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180775
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 30 Apr 2013 07:10:22 +0000 (07:10 +0000)]
Place bitfield -Wconstant-conversion warning into subgroup called -Wbitfield-constant-conversion.
This is to just allow more precise diagnostic control.
Implements <rdar://problem/
13766026>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180773
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 30 Apr 2013 06:43:16 +0000 (06:43 +0000)]
Fix very confusing indent in Sema.cpp.
This came up during my Euro LLVM 2013 talk on clang-format and I was
asked to submit it :-).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180772
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 30 Apr 2013 05:05:35 +0000 (05:05 +0000)]
[PCH] Fix memory leak related to deserialized MacroInfo objects.
Deserialized MacroInfos were not destroyed and if their SmallVector did heap allocation,
it was leaked.
rdar://
13768967
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180771
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Tue, 30 Apr 2013 01:21:43 +0000 (01:21 +0000)]
Add support for -stdlib=libc++ in the NetBSD toolchain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180766
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 30 Apr 2013 00:30:48 +0000 (00:30 +0000)]
Objective-C (mostly arc): Under ARC, we often have unneeded qualifiers
in the diagnostics. Remove them when reporting incompatible
Objective-C pointer types. // rdar://
13752880.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180765
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 29 Apr 2013 23:14:24 +0000 (23:14 +0000)]
Modify triple to try to make it pass on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180748
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 29 Apr 2013 23:13:02 +0000 (23:13 +0000)]
Just use std::list<> for PathPieces instead of complicated use of ilist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180747
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 29 Apr 2013 23:12:59 +0000 (23:12 +0000)]
Revert "[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection) PathDiagnosticPieces."
Jordan rightly pointed out that we can do the same with std::list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180746
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 29 Apr 2013 22:38:26 +0000 (22:38 +0000)]
[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection) PathDiagnosticPieces.
Much of this patch outside of PathDiagnostics.h are just minor
syntactic changes due to the return type for operator* and the like
changing for the iterator, so the real focus should be on
PathPieces itself.
This change is motivated so that we can do efficient insertion
and removal of individual pieces from within a PathPiece, just like
this was a kind of "IR" for static analyzer diagnostics. We
currently implement path transformations by iterating over an
entire PathPiece and making a copy. This isn't very natural for
some algorithms.
We use an ilist here instead of std::list because we want operations
to rip out/insert nodes in place, just like IR manipulation. This
isn't being used yet, but opens the door for more powerful
transformation algorithms on diagnostic paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180741
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 29 Apr 2013 22:38:22 +0000 (22:38 +0000)]
[analyzer] Remove comparePath's dependency on subscript operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180740
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 29 Apr 2013 22:27:16 +0000 (22:27 +0000)]
Emit the TLS intialization functions into a list.
Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'
<rdar://problem/
13733006>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180739
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 29 Apr 2013 22:01:25 +0000 (22:01 +0000)]
c language: diagnose use of "[*]" on any array dimension
in the parameter of a function definition. Currently,
it crashes in irgen if it is on other than the 1st dimension.
// rdar://
13705391
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180732
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 29 Apr 2013 19:29:25 +0000 (19:29 +0000)]
Use ArrayRef in AddMethodCandidate.
Patch by Robert Wilhelm!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180724
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 29 Apr 2013 17:31:48 +0000 (17:31 +0000)]
[test] add missing header for the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180719
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 29 Apr 2013 17:26:22 +0000 (17:26 +0000)]
When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.
rdar://
13722737
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180718
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Mon, 29 Apr 2013 17:23:06 +0000 (17:23 +0000)]
[analyzer] scan-view: don't ever serve absolute paths.
At one point in time scan-view allowed absolute paths to reference files
within the server root, but this doesn't seem to be used anymore, and
caused problems if a server-root-relative path actually matched an
absolute path to an existing file. This patch just treats paths as
server-root-relative all the time.
PR15843
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180715
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Mon, 29 Apr 2013 17:23:03 +0000 (17:23 +0000)]
Revert "[analyzer] Model casts to bool differently from other numbers."
This seems to be causing quite a slowdown on our internal analyzer bot,
and I'm not sure why. Needs further investigation.
This reverts r180638 /
9e161ea981f22ae017b6af09d660bfc3ddf16a09.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180714
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 29 Apr 2013 15:35:35 +0000 (15:35 +0000)]
Fix a typo in a parse assert.
Patch by Alex Denisov.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180712
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Mon, 29 Apr 2013 13:32:41 +0000 (13:32 +0000)]
Small CapturedStmt improvements
Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get
to the CapturedRegionKind enum. This also allows codegen to access this enum
without including Sema/ScopeInfo.h.
Also removes some duplicated code for capturing 'this' between CapturedStmt and
Lambda.
Differential Revision: http://llvm-reviews.chandlerc.com/D712
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180710
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Mon, 29 Apr 2013 13:07:42 +0000 (13:07 +0000)]
Test commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180709
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 29 Apr 2013 11:55:38 +0000 (11:55 +0000)]
Keep the parser's template depth up to date when parsing local templates and
late-parsed templates. Patch by Faisal Vali!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180708
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 29 Apr 2013 10:13:55 +0000 (10:13 +0000)]
Implement DR580: access checks for template parameters of a class template are
performed within the context of that class template. Patch by Ismail Pazarbasi!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180707
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 29 Apr 2013 08:53:40 +0000 (08:53 +0000)]
Properly reenter multiple contexts when parsing a late-parsed function template
within a dependent context. Patch by Will Wilson (+clang-format)!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180702
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 29 Apr 2013 08:45:27 +0000 (08:45 +0000)]
Fix an assertion failure / accepts-invalid in -fms-extensions mode. Don't build
a dependent-scope id expression when a templated member function of a
non-templated class references an unknown identifier, since instantiation won't
rebuild it (and we can tell at parse time that it'll never work). Based on a
patch by Faisal Vali!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180701
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Sat, 27 Apr 2013 20:23:52 +0000 (20:23 +0000)]
ArrayRef'ize Sema::ActOnEnumBody. No functionality change.
Patch by Robert Wilhelm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180682
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Sat, 27 Apr 2013 16:26:29 +0000 (16:26 +0000)]
Documentation: Change UTF-8 ellipsis character to ASCII ... sequence
Patch by Dimitry Andric
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180674
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 27 Apr 2013 15:07:53 +0000 (15:07 +0000)]
Silence a silly sign compare warning from GCC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180673
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Sat, 27 Apr 2013 13:41:02 +0000 (13:41 +0000)]
Documentation: add an idea for a cpp14-migrate transform for N3421
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180672
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 27 Apr 2013 08:42:33 +0000 (08:42 +0000)]
Exit early when $PWD isn't set. Remove unused unistd.h include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180670
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 27 Apr 2013 08:12:29 +0000 (08:12 +0000)]
Use LLVM's preferred current_path API instead of calling getcwd(3) directly.
The existing code also failed to allocate a buffer for it so getcwd corrupted
the stack. sys::fs::current_path takes care of the memory management.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180669
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 27 Apr 2013 01:14:43 +0000 (01:14 +0000)]
[driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
make the gdb tests and the Windows bots happy.
The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so
r180652 causes a gdb tests to fail. On the other hand, <sys/param.h>
isn't defined on Windows systems, so that causes Windows builds to fail.
rdar://
12237559
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180661
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 27 Apr 2013 00:57:18 +0000 (00:57 +0000)]
Fix the dangling pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180658
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Sat, 27 Apr 2013 00:39:37 +0000 (00:39 +0000)]
Struct-path aware TBAA: fix handling of may_alias attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180656
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Sat, 27 Apr 2013 00:26:07 +0000 (00:26 +0000)]
Struct-path aware TBAA: change the format of TBAAStructType node.
We switch the order of offset and field type to make TBAAStructType node
(name, parent node, offset) similar to scalar TBAA node (name, parent node).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180653
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 27 Apr 2013 00:11:10 +0000 (00:11 +0000)]
[driver] Use the llvm equivalent of getcwd(). Hopefully, this makes the Windows
bots recover.
rdar://
12237559
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180652
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 27 Apr 2013 00:10:12 +0000 (00:10 +0000)]
Fix an assertion hit in Sema::CheckObjCMethodOverrides.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180651
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 26 Apr 2013 23:34:36 +0000 (23:34 +0000)]
documenttion parsing. Provide a c-index test
and limit comment extraction to public c++
bases. // rdar://
13647476
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180646
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Callanan [Fri, 26 Apr 2013 22:49:25 +0000 (22:49 +0000)]
In the ASTImporter, when checking whether two
structs are compatible, check whether the fields
of the structs have the same name. This prevents
erroneous coalescing of (in particular) anonymous
structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180644
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 26 Apr 2013 22:47:49 +0000 (22:47 +0000)]
[libclang] Introduce clang_Module_getASTFile function that returns the module file where a module object came from.
rdar://
13743084
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180643
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Apr 2013 22:01:47 +0000 (22:01 +0000)]
Move helper classes into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180642
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Fri, 26 Apr 2013 21:43:01 +0000 (21:43 +0000)]
[analyzer] An ObjC for-in loop runs 0 times if the collection is nil.
In an Objective-C for-in loop "for (id element in collection) {}", the loop
will run 0 times if the collection is nil. This is because the for-in loop
is implemented using a protocol method that returns 0 when there are no
elements to iterate, and messages to nil will result in a 0 return value.
At some point we may want to actually model this message send, but for now
we may as well get the nil case correct, and avoid the false positives that
would come with this case.
<rdar://problem/
13744632>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180639
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Fri, 26 Apr 2013 21:42:55 +0000 (21:42 +0000)]
[analyzer] Model casts to bool differently from other numbers.
Casts to bool (and _Bool) are equivalent to checks against zero,
not truncations to 1 bit or 8 bits.
This improved reasoning does cause a change in the behavior of the alpha
BoolAssignment checker. Previously, this checker complained about statements
like "bool x = y" if 'y' was known not to be 0 or 1. Now it does not, since
that conversion is well-defined. It's hard to say what the "best" behavior
here is: this conversion is safe, but might be better written as an explicit
comparison against zero.
More usefully, besides improving our model of booleans, this fixes spurious
warnings when returning the address of a local variable cast to bool.
<rdar://problem/
13296133>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180638
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Fri, 26 Apr 2013 21:42:47 +0000 (21:42 +0000)]
[analyzer] Consolidate BoolAssignmentChecker tests by using two RUN lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180637
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 26 Apr 2013 21:33:40 +0000 (21:33 +0000)]
[PCH/modules] Require the preprocessing record option to match the used PCH, if modules are enabled.
The preprocessing record becomes important when modules are enabled, since it is used to calculate the
module cache hash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180635
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 26 Apr 2013 21:33:35 +0000 (21:33 +0000)]
[Modules] Fix an issue where the reconstructed redeclaration chain was incomplete, missing the definition from a module.
-Make sure that a deserialized external decl gets added to the TU scope.
-When associating an identifier with a set of decls, use the most recent local ones,
if they exist, otherwise associating decls from modules (that came after a local one)
will lead to an incomplete reconstructed re-declaration chain.
rdar://
13712705
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180634
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 26 Apr 2013 21:33:27 +0000 (21:33 +0000)]
[frontend] Make -chain-include work when used with modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180633
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Apr 2013 21:32:52 +0000 (21:32 +0000)]
ArrayRefize code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180632
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 26 Apr 2013 20:55:38 +0000 (20:55 +0000)]
document parsing. When a sub-class (c++ Objective-C) missing
a comment, grab the first comment found in its class
heirarchy. Also, when a category is mossing a comment,
grab comment of its primary class. // rdar://
13647476
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180629
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 26 Apr 2013 20:49:50 +0000 (20:49 +0000)]
[driver] Implement the -fdebug-compilation-dir in a way that is compatible with
gcc. No test case included as I'm having problems finding a test case where
the inode/dev don't match.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180628
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Fri, 26 Apr 2013 20:20:30 +0000 (20:20 +0000)]
Documentation: improve description of make_shared transformation, as suggested by David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180627
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Fri, 26 Apr 2013 20:12:49 +0000 (20:12 +0000)]
Comment parsing: -fparse-all-comments: recognize empty line comments
In -fparse-all-comments mode empty '//' comments were recognized as
RCK_Invalid, and were not merged with next and previous lines.
Patch by Amin Shali.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180625
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 26 Apr 2013 16:15:35 +0000 (16:15 +0000)]
Implement C++1y decltype(auto).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 26 Apr 2013 14:36:30 +0000 (14:36 +0000)]
C++1y: support simple variable assignments in constexpr functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180603
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Apr 2013 12:31:12 +0000 (12:31 +0000)]
Use bitfilds.
On a 32 bit build this moves LinkageSpecDecl from 52 to 48 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180601
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 26 Apr 2013 05:41:06 +0000 (05:41 +0000)]
Support debug info for using directives at global/namespace scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180594
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Apr 2013 01:30:23 +0000 (01:30 +0000)]
Add r180263 back, but fix hasBraces() to be correct during parsing.
Original commit message:
Fix a case in linkage computation that should check for single line extern "C".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180591
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Apr 2013 00:29:11 +0000 (00:29 +0000)]
Add a testcase for a recent regression.
Thanks to Bill Wendling for the original testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180586
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 26 Apr 2013 00:01:34 +0000 (00:01 +0000)]
Further wordsmith release notes for the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180585
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 25 Apr 2013 23:15:02 +0000 (23:15 +0000)]
Revert r180263. It's causing failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180583
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Apr 2013 23:14:38 +0000 (23:14 +0000)]
Add Static Analyzer section to the Release Notes for clang 3.3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180582
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 25 Apr 2013 21:59:34 +0000 (21:59 +0000)]
Objective-C: This is a small modification to my
patch -n r180198.
When reporting on missing property accessor implementation in
categories, do not report when they are declared in primary class,
class's protocol, or one of it super classes or in of the other
categories. // rdar://
13713098
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180580
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Apr 2013 21:52:35 +0000 (21:52 +0000)]
[analyzer] Teach DeadStoreChecker to look though BO_Comma and disregard the LHS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180579
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Apr 2013 20:12:36 +0000 (20:12 +0000)]
Put friend decls in the correct context.
When we find a friend declaration we have to skip transparent contexts for doing
lookups, but we should not skip them when inserting the new decl if the lookup
found nothing.
Fixes PR15841.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180571
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Apr 2013 16:26:20 +0000 (16:26 +0000)]
Fix a possible null pointer dereference found by the analyzer.
When computing the other parameters, ‘op’ is checked for being null before it’s dereferenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180271
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 25 Apr 2013 16:14:14 +0000 (16:14 +0000)]
Fix header comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180268
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 25 Apr 2013 16:07:10 +0000 (16:07 +0000)]
Add an idea for cpp11-migrate and cpp14-migrate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180266
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 25 Apr 2013 13:31:51 +0000 (13:31 +0000)]
Improve clang-format's memoization behavior.
Deeply nested expressions basically break clang-format's memoization.
This patch slightly improves the situations and makes expressions like
aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(
aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(
aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(
aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(
aaaaa(aaaaa())))))))))))))))))))))))))))))))))))))));
work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180264
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Apr 2013 13:10:46 +0000 (13:10 +0000)]
Fix a case in linkage computation that should check for single line extern "C".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180263
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Apr 2013 12:11:36 +0000 (12:11 +0000)]
Don't mark 'extern "C" void f(void)' as having extern storage class.
Instead, we check for one line extern "C" context in linkage computation and
when deciding if a variable is a definition.
This hopefully completes the transition to having "as written" semantics for
hasExternalStorage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180258
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 25 Apr 2013 08:56:26 +0000 (08:56 +0000)]
Add option to align escaped newlines left.
This enables formattings like:
#define A \
int aaaa; \
int b; \
int ccc; \
int
dddddddddd;
Enabling this for Google/Chromium styles only as I don't know whether it
is desired for Clang/LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180253
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 25 Apr 2013 07:06:48 +0000 (07:06 +0000)]
Fix scrolling bug in clang-format's emacs integration.
This patch ensure that nothing scrolls even if the same buffer is opened
in multiple windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180252
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 25 Apr 2013 04:25:40 +0000 (04:25 +0000)]
[ms-cxxabi] Fix a number of bugs in the mangler.
This includes the following fixes:
- Implement 4 subtly different variants of qualifier mangling and use them
in what I believe are the right places.
- Fix handling of array types. Previously we were always decaying them,
which is wrong if the type appears as a template argument, pointee,
referent etc.
Fixes PR13182.
Differential Revision: http://llvm-reviews.chandlerc.com/D709
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180250
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Thu, 25 Apr 2013 01:17:23 +0000 (01:17 +0000)]
Add "-no-canonical-prefixes" to a test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180239
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Apr 2013 00:41:32 +0000 (00:41 +0000)]
[analyzer] Fix a crash in RetainCountChecker - we should not rely on CallEnter::getCallExpr to return non-NULL
We get a CallEnter with a null expression, when processing a destructor. All other users of
CallEnter::getCallExpr work fine with null as return value.
(Addresses PR15832, Thanks to Jordan for reducing the test case!)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180234
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 25 Apr 2013 00:10:14 +0000 (00:10 +0000)]
[neonemitter tests] Change triple of emitted tests to thumbv7s to match the target cpu being swift. Also specify the target-abi to apcs-gnu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180233
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Apr 2013 23:23:47 +0000 (23:23 +0000)]
Objective-C parsing [qoi]: Recover gracefully with good diagnostic
when class implementation declaration adds protocol qualifier
list. // rdar://
12233858
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180228
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Apr 2013 19:13:05 +0000 (19:13 +0000)]
Objective-C arc: Improve disgnostics when 'weak'
property cannot be synthesized because its backing
ivar does not support weak references.
// rdar://
13676793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180211
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyotsna Verma [Wed, 24 Apr 2013 18:44:44 +0000 (18:44 +0000)]
Removing example-dynarray.cpp test since it's of no value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180208
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 24 Apr 2013 18:43:57 +0000 (18:43 +0000)]
[driver] Test that last option wins between -Ofast and -O2.
Part of rdar://
13622687
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180207
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 24 Apr 2013 18:29:59 +0000 (18:29 +0000)]
[driver] Put -fvectorize under the -Ofast umbrella flag.
Part of rdar://
13622687
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180206
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 24 Apr 2013 18:09:54 +0000 (18:09 +0000)]
[driver] Improve the implementation of the -Ofast option.
Specifically, allow the flags that fall under this umbrella (i.e., -O3,
-ffast-math, and -fstrict-aliasing) to be overridden/disabled with the
individual -O[0|1|2|s|z]/-fno- flags.
This also fixes the handling of various floating point optimization
flags that are modified by -ffast-math (and thus -Ofast as well).
Part of rdar://
13622687
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180204
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 24 Apr 2013 18:01:26 +0000 (18:01 +0000)]
[driver] Add a hasFlag API that accepts a positive alias.
Part of rdar://
13622687
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180203
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Apr 2013 17:06:38 +0000 (17:06 +0000)]
Objective-C: When reporting on missing property accessor implementation in
categories, do not report when they are declared in primary class,
class's protocol, or one of it super classes. This is because,
its class is going to implement them. // rdar://
13713098
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180198
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 24 Apr 2013 13:46:00 +0000 (13:46 +0000)]
Flip flag to merge short if-statements into one line for Google style.
This now allows clang-format to do:
if (a) return;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180187
91177308-0d34-0410-b5e6-
96231b3b80d8