]>
granicus.if.org Git - clang/log
Owen Anderson [Fri, 15 Apr 2011 17:35:58 +0000 (17:35 +0000)]
Revert r129561, which broke one of the clang buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129581
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 15 Apr 2011 17:04:42 +0000 (17:04 +0000)]
Allow shadowin of 'self' in objc methods in
cases where stand-alone ivar can be looked up
in shadowed object. To fix gcc compatibility
breakage. // rdar://
9284603
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129576
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 15 Apr 2011 15:14:40 +0000 (15:14 +0000)]
Add __has_feature(cxx_range_for) check for C++11 range-based for loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129573
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 15 Apr 2011 15:11:21 +0000 (15:11 +0000)]
Add mm3dnow.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129572
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 15 Apr 2011 15:07:13 +0000 (15:07 +0000)]
Add 3DNow! Intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129570
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 15 Apr 2011 14:38:27 +0000 (14:38 +0000)]
Update www: clang now supports C++11 for-range and non-template type aliases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129569
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 15 Apr 2011 14:24:37 +0000 (14:24 +0000)]
Support for C++11 (non-template) alias declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 15 Apr 2011 13:38:57 +0000 (13:38 +0000)]
Teach -ast-print how to print template template parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129565
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 15 Apr 2011 11:21:57 +0000 (11:21 +0000)]
Fix mismatched delete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129564
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 15 Apr 2011 10:12:39 +0000 (10:12 +0000)]
Apply NAKAMURA Takumi's workaround to fix thses tests on -Asserts build. The labels there are numbered, not named, and numbered labels are formatted differently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129562
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 15 Apr 2011 06:57:32 +0000 (06:57 +0000)]
Create a compiler-rt directory and move the Makefile to it. Add a makefile that
builds the subdirs from this directory. This makes the behaviour with make match
what already happens with cmake.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129561
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 15 Apr 2011 05:49:29 +0000 (05:49 +0000)]
Improve diagnostics on GNU attributes by warning about attributes that should have no arguments or parameters. Patch by Michael Han!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129560
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 15 Apr 2011 05:22:18 +0000 (05:22 +0000)]
fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 15 Apr 2011 00:35:57 +0000 (00:35 +0000)]
C1X: implement static asserts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129555
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 15 Apr 2011 00:35:48 +0000 (00:35 +0000)]
C1X: implement generic selections
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 15 Apr 2011 00:35:23 +0000 (00:35 +0000)]
C1X: add a language standard
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129553
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Thu, 14 Apr 2011 23:35:31 +0000 (23:35 +0000)]
Do not expand the opencl pragma names. This is so you can also have a define named the samed as the pragma and they do not interfere (ie. cl_khr_fp64).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129549
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 14 Apr 2011 23:19:27 +0000 (23:19 +0000)]
If the declaration of a C++ member function with an inline definition
is so broken that Sema can't form a declaration for it, don't bother
trying to parse the definition later. Fixes <rdar://problem/
9221993 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129547
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 14 Apr 2011 22:32:28 +0000 (22:32 +0000)]
When we transform a C++ exception declaration (e.g., for template
instantiation), be sure to add the transformed declaration into the
current DeclContext. Also, remove the -Wuninitialized hack that works
around this bug. Fixes <rdar://problem/
9200676 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129544
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 14 Apr 2011 22:09:26 +0000 (22:09 +0000)]
Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 14 Apr 2011 21:45:45 +0000 (21:45 +0000)]
Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::".
Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129540
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 14 Apr 2011 21:41:34 +0000 (21:41 +0000)]
Harden Clang's cursor visitation logic against NULL declaration,
statement, and expression pointers. While these shouldn't happen, it's
better to be safe in libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129539
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 14 Apr 2011 20:33:36 +0000 (20:33 +0000)]
Match pointer of compatible vection types.
// rdar://
9208404
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129536
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 14 Apr 2011 20:33:34 +0000 (20:33 +0000)]
When determining the "usage" type of a declaration for the purposes of code
completion, look through block pointer and function pointer types to the
result type of the block/function. Fixes <rdar://problem/
9282583 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129535
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Thu, 14 Apr 2011 20:06:49 +0000 (20:06 +0000)]
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.
In particular, all library functions should always be AAPCS regardless of floating point ABI used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129534
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 14 Apr 2011 19:57:19 +0000 (19:57 +0000)]
Name mangling of late-specified return types doesn't work if the return type references the argument types:
template<typename T> auto f(T a) -> decltype(a.foo());
Since this is the primary reason for the introduction of this feature, downgrade implementation status to "Some examples work".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129533
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 14 Apr 2011 18:36:27 +0000 (18:36 +0000)]
Implement C++0x [lex.pptoken]p3's handling of <::.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129525
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 14 Apr 2011 17:21:19 +0000 (17:21 +0000)]
Parse an '@' in an Objective-C++ class member specification,
diagnosing it as an error rather than looping infinitely. Also,
explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/
9260136 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129521
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Thu, 14 Apr 2011 14:07:59 +0000 (14:07 +0000)]
Chained PCH: Remember when additional specializations are added to a function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129516
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Thu, 14 Apr 2011 14:07:49 +0000 (14:07 +0000)]
Add header guards to include/clang/Basic/ConvertUTF.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129515
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Thu, 14 Apr 2011 14:07:45 +0000 (14:07 +0000)]
Fix -H. It was pretty broken.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129514
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Thu, 14 Apr 2011 14:07:41 +0000 (14:07 +0000)]
The ASTReader created by -chain-include used the generated PCH buffers in the wrong order. The effect was that all but the first chain-include files was ignored for subsequent compilations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129513
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 14 Apr 2011 01:50:50 +0000 (01:50 +0000)]
Return the correct lastly populated block from CFGBuilder::VisitUnaryExprOrTypeTraitExpr().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129499
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Thu, 14 Apr 2011 01:00:39 +0000 (01:00 +0000)]
Replace a couple of divide-by-8s with divide-by-charwidths. No change in
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129496
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 14 Apr 2011 00:51:41 +0000 (00:51 +0000)]
Re-fix r129481 and r129465 properly. Nulls fixits shouldn't be dropped in
DiagnosticBuilder::AddFixItHint: they will be dropped along with any
other (possibly valid) fixits later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129495
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 14 Apr 2011 00:46:47 +0000 (00:46 +0000)]
When creating an implicit member expression through a qualified-id, check that the class
named by the nested-name-specifier is same or base of the class in which the member expression appears.
It seems we also had an ill-formed test case, mon dieu! Fixes rdar://
8576107 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129493
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Thu, 14 Apr 2011 00:43:09 +0000 (00:43 +0000)]
Replace a couple of divisions-by-'8' with divisions-by-charwidth. No change
in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129491
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Thu, 14 Apr 2011 00:41:11 +0000 (00:41 +0000)]
In C++, when initializing an array from a pascal string, it's OK if the array
is 1 element smaller than the string, because we can just strip off the last
null character. This matches GCC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129490
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Thu, 14 Apr 2011 00:40:03 +0000 (00:40 +0000)]
Add a flag to StringLiteral to keep track of whether the string is a pascal string or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129488
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 13 Apr 2011 23:55:47 +0000 (23:55 +0000)]
Rename test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129486
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 13 Apr 2011 22:28:36 +0000 (22:28 +0000)]
Add -no-canonical-prefixes to tests which assert on the name of the
built clang binary that is used by the test. Build systems that use
symlinks for build outputs will fail these assertions otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129482
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 13 Apr 2011 22:18:37 +0000 (22:18 +0000)]
Issue the 2nd fixit even if fix-it hint is supressed.
// rdar://
9091893
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129481
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 13 Apr 2011 21:52:05 +0000 (21:52 +0000)]
Add Objective-C++ files to those accepted by ccc-analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129475
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 13 Apr 2011 21:48:34 +0000 (21:48 +0000)]
Update public analyzer build to checker-256.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129473
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 13 Apr 2011 20:31:26 +0000 (20:31 +0000)]
No fixit hint for builtin expressions which are
defined in a macro. // rdar://
9091893
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129465
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 20:17:22 +0000 (20:17 +0000)]
Removing the unaligned load tests from builtins-x86.c since they're generated by a regular 'load' now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129464
91177308 -0d34-0410-b5e6-
96231b3b80d8
Axel Naumann [Wed, 13 Apr 2011 13:19:46 +0000 (13:19 +0000)]
From Vassil Vassilev: Give external source's last resort lookup a chance, even if an identifier could resolve to a builtin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129438
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 10:05:14 +0000 (10:05 +0000)]
Remove comment that snuck in there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129434
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 10:02:54 +0000 (10:02 +0000)]
It looks like the FreeBSD buildbot needs this for the builtins-x86.c test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129433
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 13 Apr 2011 08:18:42 +0000 (08:18 +0000)]
Teach -Wuninitialized about C++'s typeid expression, including both the
evaluated and unevaluated contexts. Add some testing of sizeof and
typeid.
Both of the typeid tests added here were triggering warnings previously.
Now the one false positive is suppressed without suppressing the warning
on actually buggy code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129431
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 13 Apr 2011 07:15:11 +0000 (07:15 +0000)]
Collect the options applicable to the Rewriter methods into a RewriterOptions struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129430
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 05:58:17 +0000 (05:58 +0000)]
Just use a native "load" instead of translating the builtin later. Clang can
take it!
I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned
load...I'll have to look into it further.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129427
91177308 -0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Wed, 13 Apr 2011 02:44:57 +0000 (02:44 +0000)]
Still not used to put the * next to the variable name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129426
91177308 -0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Wed, 13 Apr 2011 02:38:49 +0000 (02:38 +0000)]
In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning. Up to now this is the only case I found where MSVC doesn't require "typename" at class scope. Really strange!
This fixes 1 error when parsing the MSVC 2008 header files.
Example:
template<class T> class A {
public:
typedef int TYPE;
};
template<class T> class B : public A<T> {
public:
A<T>::TYPE a; // no typename required because A<T> is a base class.
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129425
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 13 Apr 2011 02:35:36 +0000 (02:35 +0000)]
Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129424
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 13 Apr 2011 00:36:37 +0000 (00:36 +0000)]
Convert the unaligned load builtins to the first-class versions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129420
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 12 Apr 2011 23:59:20 +0000 (23:59 +0000)]
Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
undergoes preprocessing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129414
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 12 Apr 2011 23:39:33 +0000 (23:39 +0000)]
Redeclaration of 'self' should be flagged in
objective-c instead of crashing in IRgen.
// rdar://
9154582 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129412
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 12 Apr 2011 23:30:52 +0000 (23:30 +0000)]
IRgen/Obj-C: Emit CFStrings and NSStrings with the alignment of the char type,
there is no reason to align them higher.
- This roughly matches llvm-gcc's r126913.
- It is an open question whether or not we should do this for cstring's in
general (code size vs optimization potential), for now we just match llvm-gcc
until someone wants to run some experiments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129410
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 22:02:02 +0000 (22:02 +0000)]
We can't emit an aggregate cast as its sub-expression in general just
because the result is ignored. The particular example here is with
property l-values, but there could be all sorts of lovely casts that this
isn't safe for. Sink the check into the one case that seems to actually
be capable of honoring this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129397
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 12 Apr 2011 21:53:33 +0000 (21:53 +0000)]
Driver: Don't treat -m{abi,arch,cpu,cmodel}= as "driver" options, they don't
modify the driver planning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129396
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 21:47:05 +0000 (21:47 +0000)]
Teach VariadicMethodTypeChecker to not crash when processing methods declared in protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129395
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 21:47:02 +0000 (21:47 +0000)]
Fix another IdempotentOperationsChecker corner case when determining if an active block on the worklist
impacts the results of the check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129394
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 21:47:00 +0000 (21:47 +0000)]
Provide options to explicitly enable/disable checkers in scan-build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129393
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 21:46:57 +0000 (21:46 +0000)]
Enable C++ static analysis support in ccc-analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129392
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 17:21:33 +0000 (17:21 +0000)]
ArrayBoundCheckerV2: don't arbitrarily warn about indexing before the 0-index of a symbolic region. In many cases that isn't really the base offset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129366
91177308 -0d34-0410-b5e6-
96231b3b80d8
Lenny Maiorani [Tue, 12 Apr 2011 17:08:43 +0000 (17:08 +0000)]
This patch adds modeling of strcmp() to the CString checker. Validates inputs are not NULL and are real C strings, then does the comparison and binds the proper return value. Unit tests included.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129364
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 12 Apr 2011 16:34:14 +0000 (16:34 +0000)]
Fix a regression where the initializer implements
the initialized's protocol and yet clang warns.
objective-c issue, // rdar://
9267196
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129363
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 12 Apr 2011 10:38:03 +0000 (10:38 +0000)]
Fix AST serialization of reference-to-reference types. This previously caused
a crash when deserializing the AST for this:
typedef char (&R);
extern R &r;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129358
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 05:12:39 +0000 (05:12 +0000)]
static analyzer: invalidate by-ref arguments passed to constructors in a 'new' expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129349
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 03:49:37 +0000 (03:49 +0000)]
Fix bug in SimpleSValBuilder where '--' pointer arithmetic was treated like '++' pointer arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129348
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 12 Apr 2011 02:47:21 +0000 (02:47 +0000)]
Don't suggest dynamic_cast or typeid as code completion results when
RTTI is disabled. Similarly, don't suggest throw or try as code
completion results when C++ exceptions are disabled. Fixes
<rdar://problem/
9193560 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129346
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 01:46:54 +0000 (01:46 +0000)]
Template static data members can have weak_odr linkage, not just
weak linkage. Also, fix a problem where global weak variables
with non-trivial initializers were getting guard variables, or at
least were checking for them and then crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129342
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 01:15:45 +0000 (01:15 +0000)]
Whoops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129341
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 12 Apr 2011 01:02:45 +0000 (01:02 +0000)]
Objective-C++: The global namespace is an associated namespace of an
Objective-C pointer type. Fixes <rdar://problem/
9142559 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129339
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 01:01:22 +0000 (01:01 +0000)]
Ignore indirect field declarations. Fixes PR9570.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129337
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 00:59:32 +0000 (00:59 +0000)]
Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129336
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 00:57:12 +0000 (00:57 +0000)]
This test works now; enable it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129335
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 00:44:31 +0000 (00:44 +0000)]
RegionStoreManager::invalidateRegions: treat classes the same as structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129333
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 12 Apr 2011 00:42:48 +0000 (00:42 +0000)]
After some discussion with Doug, we decided that it made a lot more sense
for __unknown_anytype resolution to destructively modify the AST. So that's
what it does now, which significantly simplifies some of the implementation.
Normal member calls work pretty cleanly now, and I added support for
propagating unknown-ness through &.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129331
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 12 Apr 2011 00:28:12 +0000 (00:28 +0000)]
Teach GRState::getSValAsScalarOrLoc() about C++ references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129329
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 11 Apr 2011 22:22:05 +0000 (22:22 +0000)]
C++ static analysis: also invalidate fields of objects that are the callees in C++ method calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129308
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 11 Apr 2011 21:26:35 +0000 (21:26 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129301
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 11 Apr 2011 21:17:02 +0000 (21:17 +0000)]
Fixup more objc rwriter bug having to do with
rewriting of blocks which have objective-c
stuff which need be rewritten as well. // rdar://
9254348
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129300
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 11 Apr 2011 21:15:37 +0000 (21:15 +0000)]
fix the path to ld.so for darwin/ppc, resolving PR9677. Patch
by Jeremy Huddleston!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129299
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 14:13:40 +0000 (14:13 +0000)]
If there's an invoke destination, we should use invoke instead of call when calling the __cxa_bad_typeid function. Fixes PR7400.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129273
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 11 Apr 2011 07:02:50 +0000 (07:02 +0000)]
More __unknown_anytype work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129269
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 02:03:26 +0000 (02:03 +0000)]
Remove CK_DynamicToNull.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129265
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 01:45:29 +0000 (01:45 +0000)]
When we know that a dynamic_cast always returns null, we can make
CodeGenFunction::EmitDynamicCast always return null or throw a bad_cast
exception.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129264
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 01:43:55 +0000 (01:43 +0000)]
Add CXXDynamicCastExpr::isAlwaysNull() which will be replacing the cast kind I added.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129263
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 00:46:40 +0000 (00:46 +0000)]
Clean up CodeGenFunction::EmitDynamicCast. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129262
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 11 Apr 2011 00:30:07 +0000 (00:30 +0000)]
Replace a couple of Builder.CreateICmpEQ with Builder.CreateIsNull. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129261
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 11 Apr 2011 00:23:45 +0000 (00:23 +0000)]
PR9669: implement correct checking for [dcl.init.string]p2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129260
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 10 Apr 2011 23:15:15 +0000 (23:15 +0000)]
Remove the CodeGenCXX/dyncast.cpp test; it isn't really super useful to match on huge chunks of LLVM output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129258
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 10 Apr 2011 20:33:22 +0000 (20:33 +0000)]
As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind which
represents a dynamic cast where we know that the result is always null.
For example:
struct A {
virtual ~A();
};
struct B final : A { };
struct C { };
bool f(B* b) {
return dynamic_cast<C*>(b);
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129256
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Sun, 10 Apr 2011 19:13:55 +0000 (19:13 +0000)]
Simplify calling CheckPlaceholderExpr, converge on it in a few places,
and move a vector-splat check to follow l-value conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129254
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 10 Apr 2011 18:20:53 +0000 (18:20 +0000)]
Strip off parens and no-op casts when deciding if an expr can be devirtualized. Fixes the second half of PR9660.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129253
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 10 Apr 2011 18:00:32 +0000 (18:00 +0000)]
Change CollectPrimaryBases to collect the bases in the right order. Fixes one half of PR9660.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129252
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 10 Apr 2011 17:42:45 +0000 (17:42 +0000)]
Make -fdump-vtable-layouts also dump vtable indices for all virtual member functions in the class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129250
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Sun, 10 Apr 2011 16:17:31 +0000 (16:17 +0000)]
Reflect rename on LLVM cmake file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129246
91177308 -0d34-0410-b5e6-
96231b3b80d8