Commit Graph

12400 Commits

Author SHA1 Message Date
Daniel Dunbar b3675dd660 tests: Remove some stray and unused -cc1 flags. These tests appear to be written
to go through the driver.

llvm-svn: 143791
2011-11-05 05:41:57 +00:00
Eli Friedman ce6733a542 Fix test so that it XFAILs consistently.
llvm-svn: 143771
2011-11-05 00:49:47 +00:00
Ted Kremenek 04268232df Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.
llvm-svn: 143766
2011-11-05 00:10:15 +00:00
Argyrios Kyrtzidis 6b2d47d829 [arcmt] In GC, error out when there is a call that returns a pointer to
GC managed non-objc object memory.

llvm-svn: 143747
2011-11-04 23:43:03 +00:00
Devang Patel 384dfa4f10 Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.
llvm-svn: 143733
2011-11-04 20:05:58 +00:00
Chad Rosier c2bf338d35 [driver] Don't blindly accept all -g options.
rdar://10383444

llvm-svn: 143732
2011-11-04 19:28:44 +00:00
Devang Patel 2ccf84e3a5 Revert r143551. It is causing g++.dg/template/crash52.C test failure.
llvm-svn: 143725
2011-11-04 18:52:43 +00:00
Fariborz Jahanian 37c6417949 objc: fixed enum type is supported in objc mode.
Fixes a bug where enumerator type is not this
fixed type. // rdar://10381507

llvm-svn: 143724
2011-11-04 18:51:24 +00:00
Richard Smith fe5354b945 Clean up C++11 constant expression testing.
llvm-svn: 143720
2011-11-04 18:32:57 +00:00
Devang Patel 45124500bb Add new test.
llvm-svn: 143706
2011-11-04 17:12:03 +00:00
Devang Patel f1faeefb32 Add new test.
llvm-svn: 143704
2011-11-04 16:57:26 +00:00
Argyrios Kyrtzidis d2b9112354 [arcmt] For GC, cleanup and turn -finalize to -dealloc.
llvm-svn: 143701
2011-11-04 15:58:22 +00:00
Argyrios Kyrtzidis d8cdfbc905 [arcmt] In GC, error for use of CFMakeCollectable because it will leak the
object that it receives in ARC.

llvm-svn: 143700
2011-11-04 15:58:17 +00:00
Argyrios Kyrtzidis 3eaa22af57 In C++ keep unavailable function calls in the AST, like in C/ObjC.
This allows the migrator to visit and fix them.

llvm-svn: 143699
2011-11-04 15:58:13 +00:00
Argyrios Kyrtzidis d208ef95aa [arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.
llvm-svn: 143698
2011-11-04 15:58:08 +00:00
Richard Smith 96e0c101fe Constant expression evaluation: track the manner in which an lvalue was written,
to allow us to implement the C++11 rule that a non-active union member can't be
read, and use it to implement subobject access for string literals.

llvm-svn: 143677
2011-11-04 02:25:55 +00:00
Richard Smith e9e20dd302 Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.

llvm-svn: 143674
2011-11-04 01:10:57 +00:00
Eli Friedman 3d9f47fe6f Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
llvm-svn: 143658
2011-11-03 21:39:02 +00:00
Eli Friedman eadd3e81a0 Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
llvm-svn: 143645
2011-11-03 20:31:28 +00:00
Argyrios Kyrtzidis f50f7b2c65 [libclang] Fix crash when a #pragma diagnostic is included in the preamble.
A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

llvm-svn: 143644
2011-11-03 20:28:19 +00:00
Douglas Gregor 7f763f1018 Force test to use the non-fragile ABI
llvm-svn: 143642
2011-11-03 19:58:50 +00:00
Argyrios Kyrtzidis 04cf92fe7c [libclang] Make sure pointing inside the #include of the fields will return the struct.
llvm-svn: 143638
2011-11-03 19:02:30 +00:00
Argyrios Kyrtzidis deb47d17dd [libclang] Add a test for "targeting" a field inside an #include that only
contains fields.

llvm-svn: 143636
2011-11-03 19:01:07 +00:00
Douglas Gregor 21ceb18429 Extend IsSimplyAccessible to check for Objective-C instance variable
accessibility. Fixes <rdar://problem/3727335>.

llvm-svn: 143635
2011-11-03 19:00:24 +00:00
Douglas Gregor dd847baadd When we're checking a friend function template in an out-of-line class
definition, we may not have a scope corresponding to the namespace
where that friend function template actually lives. Work around this
issue by faking up a scope with the appropriate DeclContext.

This is a bit of a hack, but it fixes <rdar://problem/10204947>.

llvm-svn: 143614
2011-11-03 16:37:14 +00:00
Argyrios Kyrtzidis e968152564 [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

llvm-svn: 143605
2011-11-03 02:20:32 +00:00
Douglas Gregor 2e10cf9620 Add a printing policy flag to suppress printing "<anonymous>::" prior
to types. Enable this flag for code completion, where knowing whether
something is in an anonymous or inline namespace is actually not
useful, since you don't have to type it anyway. Fixes
<rdar://problem/10208818>.

llvm-svn: 143599
2011-11-03 00:16:13 +00:00
Douglas Gregor e7f0675672 Test code completion for constructor initializers within the class
definition. This already worked; <rdar://problem/10208871>.

llvm-svn: 143595
2011-11-02 23:39:56 +00:00
Douglas Gregor 10f939c3db Don't build member initializers for zero-length or incomplete arrays,
and don't try to destroy them, either. Fixes
<rdar://problem/10228639>.

llvm-svn: 143584
2011-11-02 23:04:16 +00:00
Fariborz Jahanian 10317eaa28 back out changes in r143399 and r143475.
rvale-references are captured by reference
in blocks. // rdar://9971124.

llvm-svn: 143583
2011-11-02 22:53:43 +00:00
Douglas Gregor 8f5653a999 Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case). 

Fixes <rdar://problem/9676205>.

llvm-svn: 143551
2011-11-02 17:38:53 +00:00
Bob Wilson 1d9269a8d6 Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
llvm-svn: 143530
2011-11-02 04:51:36 +00:00
Eli Friedman 055c970839 Add an option to emulate the strange Apple gcc behavior of #pragma pack.
<rdar://problem/10374763>

llvm-svn: 143527
2011-11-02 01:53:16 +00:00
Fariborz Jahanian 3018b95093 objc: warn if a readonly property has a setter attribute too.
// rdar://10357768

llvm-svn: 143518
2011-11-01 23:02:16 +00:00
Anna Zaks 9e82c62222 [analyzer] Fix PR11282 - an assert in markAsSink
This is another fallout from the refactoring. We were
calling MarkAsSink on a cached out node.
(Fixes radar://10376675)

llvm-svn: 143516
2011-11-01 22:41:14 +00:00
Anna Zaks 6d319489df [analyzer] BranchNodeBuilder should not generate autotransitions.
This fixes radar://10367606

llvm-svn: 143514
2011-11-01 22:41:06 +00:00
Douglas Gregor c3ae7c363e When we run into a constructor or destructor that is defined in the
wrong class, make sure to drop it immediately; we don't want that
constructor to be available within the DeclContext. Fixes
<rdar://problem/9677163>.

llvm-svn: 143506
2011-11-01 22:13:30 +00:00
Richard Smith 1a77e8d10d Fix r143463 to test what it was intended to test.
llvm-svn: 143505
2011-11-01 21:48:46 +00:00
Douglas Gregor fe0055e6c8 When we see an out-of-line definition of a member class template that
does not match any declaration in the class (or class template), be
sure to mark it as invalid. Fixes PR10924 / <rdar://problem/10119422>.

llvm-svn: 143504
2011-11-01 21:35:16 +00:00
Richard Smith cecf184e64 When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.

llvm-svn: 143496
2011-11-01 21:06:14 +00:00
Richard Smith 1f1f2d8ca3 Temporarily disable lvalue-to-rvalue conversions on const pointers while an
apparent miscompile triggered by this is investigated. This is essentially a
revert of r143298.

llvm-svn: 143491
2011-11-01 20:38:59 +00:00
Argyrios Kyrtzidis 1f49cda14f [libclang] Fix non-darwin buildbots.
llvm-svn: 143477
2011-11-01 19:47:41 +00:00
Fariborz Jahanian ab92b753d6 Find copy constructor needed to copy an rvalue reference
c++ object into block descriptor. // rdar://9971124

llvm-svn: 143475
2011-11-01 18:57:34 +00:00
Ted Kremenek 5d6044e413 Downgrade err_iboutlet_object_type to a warning. It was breaking a bunch of code. We will reconsider promoting it back to an error later.
llvm-svn: 143470
2011-11-01 18:08:35 +00:00
Argyrios Kyrtzidis b9689bb46f [libclang] For a class extension, give it a unique USR but for any property or ivar
it contains give it a USR based on its semantic context, which is the interface.

This follows what we already did for objc methods. rdar://10371669

llvm-svn: 143464
2011-11-01 17:14:12 +00:00
Richard Smith fec0992aca Implement C++11 'constexpr calls must return constant expressions' rule, and
perform the code simplifications this rule allows.

llvm-svn: 143463
2011-11-01 16:57:24 +00:00
Sebastian Redl 72ef7bc2b5 Enable function call and some overload resolution with parameters of aggregate class type and initializer list arguments.
llvm-svn: 143462
2011-11-01 15:53:09 +00:00
Eli Friedman 86fe42d184 Correct test for additional comment line.
llvm-svn: 143436
2011-11-01 04:46:08 +00:00
Eli Friedman e1f2ce8fd3 Mark test as requiring x86 backend.
llvm-svn: 143427
2011-11-01 03:48:36 +00:00
Eli Friedman 97ed64081d Don't depend on system includes in test.
llvm-svn: 143426
2011-11-01 03:35:57 +00:00