summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that we delete destructors in the right cases. Specifically:Richard Smith2012-02-263-105/+100
| | | | | | | | | | | | | | - variant members with nontrivial destructors make the containing class's destructor deleted - check for a virtual destructor after checking for overridden methods in the base class(es) - check for an inaccessible operator delete for a class with a virtual destructor. Do not try to call an anonymous union field's destructor from the destructor of the containing class. llvm-svn: 151483
* Add support for PPC and PPC64 multiarch toolchains on Debain.Chandler Carruth2012-02-261-0/+9
| | | | | | | | | | | | | | | | | Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added 64-bit support. I just added one other place where powerpc64-linux-gnu was missing (we only had powerpc64-unknown-linux-gnu). I've also added a tree to test out the debian multiarch stuff. I don't use debian regularly, so I'm not certain this is entirely accurate. If anyone wants to check it against a debian system and fix any inaccuracies, fire away. This way at least folks can see how this is *supposed* to be tested. It'd be particularly good to get the Debian MIPS toolchains tested in this way. llvm-svn: 151482
* Make sure we don't try to produce a definition of an implicitly-deleted functionRichard Smith2012-02-262-8/+15
| | | | llvm-svn: 151478
* Special members which are defaulted or deleted on their first declaration areRichard Smith2012-02-261-0/+53
| | | | | | | | | | | | | trivial if the implicit declaration would be. Don't forget to set the Trivial flag on the special member as well as on the class. It doesn't seem ideal that we have two separate mechanisms for storing this information, but this patch does not attempt to address that. This leaves us in an interesting position where the has_trivial_X trait for a class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'. This seems to be what the standard requires. llvm-svn: 151465
* Revert r151460 as it is not enough to address the issue.Argyrios Kyrtzidis2012-02-251-52/+38
| | | | | | | | | | | Original log: When evaluating integer expressions handle logical operators outside VisitBinaryOperator() to reduce stack pressure for source with huge number of logical operators. Fixes rdar://10913206. llvm-svn: 151464
* Richard Smith pointed out that there already is a proposal for init list ↵Sebastian Redl2012-02-251-8/+18
| | | | | | mangling. llvm-svn: 151462
* When evaluating integer expressions handle logical operators outsideArgyrios Kyrtzidis2012-02-251-34/+48
| | | | | | | | | VisitBinaryOperator() to reduce stack pressure for source with huge number of logical operators. Fixes rdar://10913206. llvm-svn: 151460
* Initializer lists are now supported.Sebastian Redl2012-02-251-1/+1
| | | | llvm-svn: 151458
* CodeGen support for global variables of type std::initializer_list<X>.Sebastian Redl2012-02-253-3/+121
| | | | | | | | | | | | | This emits a backing array with internal linkage and fills it with data, then has the initializer_list point at the array. Dynamic initialization and global destructors are correctly supported. What doesn't work is nested initializer_lists. I have no idea how to get them to work, either. However, these should be very rare, and so I'll just call it a known bug and declare generalized initializers DONE! llvm-svn: 151457
* Fix crashers on unexpected std::initializer_list layouts. Found by inspection.Sebastian Redl2012-02-251-0/+4
| | | | llvm-svn: 151456
* Better mangling for new-expressions. Also, although we can't mangle ↵Sebastian Redl2012-02-251-4/+15
| | | | | | arbitrary initializer lists yet (we will need this), turn the crash into a controlled error. llvm-svn: 151455
* Temporarily revert r151288:Chad Rosier2012-02-251-2/+3
| | | | | | ARM: enable the integrated assembler by default for Darwin. llvm-svn: 151454
* ArrayRef'ize various functions in the AST/Parser/Sema.Ahmed Charles2012-02-2510-202/+220
| | | | llvm-svn: 151447
* Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (andRichard Smith2012-02-252-3/+15
| | | | | | likewise for __has_extension). Patch by Jonathan Sauer! llvm-svn: 151445
* Fix r151443 to only apply C++11's exception for non-static data member accessRichard Smith2012-02-251-5/+14
| | | | | | | in cases where we would otherwise disallow the access, and add a -Wc++98-compat diagnostic for this C++11 feature. llvm-svn: 151444
* PR11956: C++11's special exception for accessing non-static data members fromRichard Smith2012-02-251-15/+15
| | | | | | unevaluated operands applies within member functions, too. llvm-svn: 151443
* Fix assertion (too few Diag arguments) when diagnosing a deleted operator deleteRichard Smith2012-02-251-1/+2
| | | | llvm-svn: 151442
* Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes andRichard Smith2012-02-254-3/+42
| | | | | | | | | data members for deleted or user-provided destructors. Now it's computed in advance, serialize it, and in passing fix all the other record DefinitionData flags whose serialization was missing. llvm-svn: 151441
* Fix a regression from r151117: ADL requires that we attempt to complete anyRichard Smith2012-02-252-6/+13
| | | | | | | | associated classes, since it can find friend functions declared within them, but overload resolution does not otherwise require argument types to be complete. llvm-svn: 151434
* Prevent llvm.lifetime intrinsics from being emitted at -O0.Chad Rosier2012-02-251-1/+5
| | | | | | rdar://10921594 llvm-svn: 151430
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-255-32/+96
| | | | | | implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
* Don't record nested macro expansions in the preprocessing record,Argyrios Kyrtzidis2012-02-255-22/+11
| | | | | | | | it can only bring pain when dealing with preprocessor abuse (see: boost). rdar://10898986 llvm-svn: 151427
* RetainCountChecker: don't adjust the retain count when analyzing a ↵Ted Kremenek2012-02-251-0/+15
| | | | | | ReturnStmt unless we are in the top-level call frame. We can do more later, but this makes the checker self-consistent (and fixes a crash). llvm-svn: 151426
* [arcmt] GC migrator: don't try to remove redundant __strong, it doesArgyrios Kyrtzidis2012-02-251-25/+0
| | | | | | | | more harm than good. Fixes rdar://10522805&10521433 llvm-svn: 151424
* Improve the diagnostic in ARC mode when a conditional with an Objective-C ↵Eli Friedman2012-02-251-0/+16
| | | | | | type and void* is used. <rdar://problem/10486347>. llvm-svn: 151416
* Trying to increase my Ohloh ranking with trivial tweaksDouglas Gregor2012-02-251-6/+2
| | | | llvm-svn: 151414
* Bugfix: bogus warning -- "invalid use of non-static data member",DeLesley Hutchins2012-02-251-1/+2
| | | | | | | when a class is forward declared, and the reference to the data member in question does not occur within a method body. llvm-svn: 151413
* Simplify check per Eli's commentDouglas Gregor2012-02-251-4/+1
| | | | llvm-svn: 151412
* [analyzer] Malloc: reason about the ObjC messages and C++.Anna Zaks2012-02-241-20/+56
| | | | | | | | | | | Assume none of the ObjC messages defined in system headers free memory, except for the ones containing 'freeWhenDone' selector. Currently, just assume that the region escapes to the messages with 'freeWhenDone' (ideally, we want to treat it as 'free()'). For now, always assume that regions escape when passed to C++ methods. llvm-svn: 151410
* Implement C++11 [over.match.copy]p1b2, which allows the use ofDouglas Gregor2012-02-244-18/+52
| | | | | | | | | | | explicit conversion functions to initialize the argument to a copy/move constructor that itself is the subject of direct initialization. Since we don't have that much context in overload resolution, we end up threading more flags :(. Fixes <rdar://problem/10903741> / PR10456. llvm-svn: 151409
* Fix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.Eli Friedman2012-02-241-3/+5
| | | | llvm-svn: 151407
* For the purposes of building LLVM types, a forward-declaredDouglas Gregor2012-02-241-1/+6
| | | | | | | enumeration type with a fixed underlying type is complete. Fixes <rdar://problem/10916155>. llvm-svn: 151403
* Back out __decltype warning from r151377: we should either warn on all the GNURichard Smith2012-02-241-2/+2
| | | | | | __keywords or none of them. llvm-svn: 151401
* Make helper static.Benjamin Kramer2012-02-241-1/+1
| | | | llvm-svn: 151400
* When checking whether a reference to a variable is an ICE, look at the type ofRichard Smith2012-02-241-4/+5
| | | | | | | the declaration, not at the type of the DeclRefExpr, since within a lambda the DeclRefExpr can be more const than the declaration is. llvm-svn: 151399
* Minor modern rewriter bug showed up during testingFariborz Jahanian2012-02-241-1/+1
| | | | | | against a large project. llvm-svn: 151395
* C++11 [class.ctor]p5 says thatDouglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | | | | | | A defaulted default constructor for a class X is defined as deleted if [...] - X is a union and all of its variant members are of const-qualified type. A pedantic reading therefore says that union X { }; has a deleted default constructor, which is both silly and almost certainly unintended. Pretend as if this this read - X is a union with one or more variant members, and all of its variant members are of const-qualified type. llvm-svn: 151394
* Fix comment: correct predicate name, reformat comment.Dmitri Gribenko2012-02-241-5/+4
| | | | llvm-svn: 151389
* Change the text of a FIXME.Argyrios Kyrtzidis2012-02-241-1/+2
| | | | llvm-svn: 151387
* __decltype is a GNU extension, not a C++11 extension.Richard Smith2012-02-242-2/+3
| | | | llvm-svn: 151377
* Two minor, related fixes for template instantiation with blocks:Douglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | - Make sure that the block expression is instantiation-dependent if the block is in a dependent context - Make sure that the C++ 'this' expression gets captured even if we don't rebuild the AST node during template instantiation. This would also have manifested as a bug for lambdas. Fixes <rdar://problem/10832617>. llvm-svn: 151372
* objc modern translator. Fixes writing of block pointer ivar access.Fariborz Jahanian2012-02-241-1/+3
| | | | llvm-svn: 151371
* [analyzer] Run remove dead bindings before each call.Anna Zaks2012-02-241-1/+5
| | | | | | | This ensures that we report the bugs associated with symbols going out of scope in the correct function context. llvm-svn: 151369
* [analyzer] We were silently stopping exploring the path afterAnna Zaks2012-02-241-3/+0
| | | | | | | | | visiting 'return;' statement! This most likely caused us to skip a bunch of code when analyzing with inlining. llvm-svn: 151368
* Revert r151357. That unreachable is reachable...Nick Lewycky2012-02-241-11/+8
| | | | llvm-svn: 151359
* Silence gcc warnings pointing out that CharByteWidth could be usedNick Lewycky2012-02-241-8/+11
| | | | | | uninitialized. While there, restyle this function! No functionality change. llvm-svn: 151357
* Sink variable into assertMatt Beaumont-Gay2012-02-241-2/+1
| | | | llvm-svn: 151356
* Remove some trivial uses of hasTrivialCopyConstructor() andDouglas Gregor2012-02-241-2/+2
| | | | | | hasTrivialMoveConstructor(). llvm-svn: 151354
* Kill a spurious use of hasTrivialDefaultConstructor()Douglas Gregor2012-02-241-2/+1
| | | | llvm-svn: 151353
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-2416-1/+426
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
OpenPOWER on IntegriCloud