summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-263-56/+15
| | | | | | dtor cleanup use it. llvm-svn: 124309
* Rvalue references for *this: allow functions to be overloaded based onDouglas Gregor2011-01-261-2/+3
| | | | | | | | | the presence and form of a ref-qualifier. Note that we do *not* yet implement the restriction in C++0x [over.load]p2 that requires either all non-static functions with a given parameter-type-list to have a ref-qualifier or none of them to have a ref-qualifier. llvm-svn: 124297
* Rvalue references for *this: add name mangling for ref-qualifiers,Douglas Gregor2011-01-261-4/+28
| | | | | | | | using rules that I just made up this morning. This encoding has now been proposed to the Itanium C++ ABI group for inclusion, but of course it's still possible that the mangling will change. llvm-svn: 124296
* Rvalue references for *this: tentative parsing and template argument deduction.Douglas Gregor2011-01-262-5/+9
| | | | llvm-svn: 124295
* Reference qualifiers for *this: implement C++0x [expr.mptr.oper]p6,Douglas Gregor2011-01-261-0/+26
| | | | | | | the restrictions on .* and ->* for ref-qualified pointer-to-member functions. llvm-svn: 124294
* Clean up the C++0x __has_feature tests. Specifically:Douglas Gregor2011-01-261-10/+11
| | | | | | | | | | | | | - Don't publicize a C++0x feature through __has_feature if we aren't in C++0x mode (even if the feature is available only with a warning). - "auto" is not implemented well enough for its __has_feature to be turned on. - Fix the test of C++0x __has_feature to actually test what we're trying to test. Searching for the substring "foo" when our options are "foo" and "no_foo" doesn't work :) llvm-svn: 124291
* Reinstate r124236 (tweaking the rvalue-reference overload resolutionDouglas Gregor2011-01-261-18/+53
| | | | | | rules), now that we've actually have a clean build for me to sully. llvm-svn: 124290
* Rvalue references for *this: Douglas Gregor2011-01-268-17/+86
| | | | | | | | | | | | - Add ref-qualifiers to the type system; they are part of the canonical type. Print & profile ref-qualifiers - Translate the ref-qualifier from the Declarator chunk for functions to the function type. - Diagnose mis-uses of ref-qualifiers w.r.t. static member functions, free functions, constructors, destructors, etc. - Add serialization and deserialization of ref-qualifiers. llvm-svn: 124281
* Teach -Wreturn-type that destructors can appearTed Kremenek2011-01-261-11/+14
| | | | | | | | | after a 'return' in a CFGBlock. This accidentally was working before, but the false assumption that 'return' always appeared at the end of the block was uncovered by a recent change. llvm-svn: 124280
* Tweak -Wuninitialized-experimental to not emitTed Kremenek2011-01-261-3/+13
| | | | | | | a warning for uses of an uninitialized variable when the use is a void cast, e.g. (void) x. llvm-svn: 124278
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-268-79/+296
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* Rvalue references for *this: parse ref-qualifiers.Douglas Gregor2011-01-265-3/+39
| | | | llvm-svn: 124276
* Use RecordLayout::getBaseClassOffset() where CharUnits are needed instead ofKen Dyck2011-01-261-7/+4
| | | | | | converting getBaseClassOffsetInBits() to CharUnits. llvm-svn: 124274
* [analyzer] Enable the self-init checker under command-line option ↵Argyrios Kyrtzidis2011-01-264-1/+7
| | | | | | | | '-analyzer-check-objc-self-init' which by default is enabled by the driver for '--analyze'. llvm-svn: 124266
* Correct r124242 making sure function chunk that gets diagnosed is really ↵Argyrios Kyrtzidis2011-01-261-1/+4
| | | | | | | | about the block. Clairvoyance by John! llvm-svn: 124264
* [analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!Argyrios Kyrtzidis2011-01-261-4/+6
| | | | llvm-svn: 124263
* Tweak the rule for deciding if a provisional ivar is neededFariborz Jahanian2011-01-261-1/+2
| | | | | | in default ivar synthesis. Fixes // rdar://8913053. llvm-svn: 124258
* [analyzer] Do the self-init check only on NSObject subclasses. Patch by ↵Argyrios Kyrtzidis2011-01-251-2/+14
| | | | | | Jean-Daniel Dupas! llvm-svn: 124249
* Speculatively revert r124236Douglas Gregor2011-01-251-53/+18
| | | | llvm-svn: 124247
* Diagnose calling convention attribute incompatibilities. Fixes rdar://8876096.Argyrios Kyrtzidis2011-01-251-1/+22
| | | | llvm-svn: 124244
* Fix infinite loop during error diagnostics. Fixes rdar://8875304.Argyrios Kyrtzidis2011-01-251-1/+1
| | | | llvm-svn: 124243
* Change error "function cannot return array type" -> "blocks cannot return ↵Argyrios Kyrtzidis2011-01-251-2/+4
| | | | | | | | array type" when blocks are involved. Addresses rdar://8876238. llvm-svn: 124242
* Fix regression in -Wreturn-type caused by notTed Kremenek2011-01-251-12/+3
| | | | | | | | | | handling all CFGElement kinds. While writing the test case, it turned out that return-noreturn.cpp wasn't actually testing anything since it has the wrong -W flag. That uncovered another regression with the handling of destructors marked noreturn. WIP. llvm-svn: 124238
* Speculatively implement a tweak to the C++0x overload resolution rulesDouglas Gregor2011-01-251-18/+53
| | | | | | | | | | | | | | for reference binding (C++ [over.rank.ics]p3b1sb4), so that we prefer the binding of an lvalue reference to a function lvalue over the binding of an rvalue reference. This change resolves the ambiguity with std::forward and lvalue references to function types in a way that seems consistent with the original rvalue references proposal. My proposed wording for this change is shown in isBetterReferenceBindingKind(); we'll try to get this change adopted in the C++0x working paper as well. llvm-svn: 124236
* Unbreak CMake build.Ted Kremenek2011-01-251-0/+1
| | | | llvm-svn: 124235
* Don't try and symbolicate unions; we don't reasonTed Kremenek2011-01-251-1/+3
| | | | | | about them yet. Fixes crash reported in PR 9049. llvm-svn: 124228
* Add -add-plugin flag, which runs plugins in addition to codegen.Nico Weber2011-01-254-11/+274
| | | | llvm-svn: 124227
* Add an attribute to forbid temporary instances of a type. This allows classJeffrey Yasskin2011-01-253-1/+25
| | | | | | | | | | | | | | | authors to write class __attribute__((forbid_temporaries)) Name { ... }; when they want to force users to name all variables of the type. This protects people from doing things like creating a scoped_lock that only lives for a single statement instead of an entire scope. The warning produced by this attribute can be disabled by -Wno-forbid-temporaries. llvm-svn: 124217
* Fix the ranking of reference bindings during overload resolutionDouglas Gregor2011-01-251-2/+2
| | | | | | | | | | | | | | | | | | (C++0x [over.ics.rank]p3) when one binding is an lvalue reference and the other is an rvalue reference that binds to an rvalue. In particular, we were using the predict "is an rvalue reference" rather than "is an rvalue reference that binds to an rvalue", which was incorrect in the one case where an rvalue reference can bind to an lvalue: function references. This particular issue cropped up with std::forward, where Clang was picking an std::forward overload while forwarding an (lvalue) reference to a function. However (and unfortunately!), the right answer for this code is that the call to std::forward is ambiguous. Clang now gets that right, but we need to revisit the std::forward implementation in libc++. llvm-svn: 124216
* Recycle memory for GRStates that are never referencedTed Kremenek2011-01-252-4/+27
| | | | | | | | by ExplodedNodes. This leads to about a 4-8% reduction in memory footprint when analyzing functions in sqlite3. llvm-svn: 124214
* Teach -Wuninitialized-experimental to also warnTed Kremenek2011-01-252-18/+48
| | | | | | about uninitialized variables captured by blocks. llvm-svn: 124213
* Tweak wording of static analyzer diagnosticTed Kremenek2011-01-251-3/+3
| | | | | | | for a block capturing the value of an uninitialized variable. llvm-svn: 124212
* Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actuallyDouglas Gregor2011-01-255-14/+54
| | | | | | | | | generate meaningful [*] template argument location information. [*] Well, as meaningful as possible, given that this entire code path is a hack for when we've lost type-source information. llvm-svn: 124211
* Don't insert class templates into the DynamicClasses vector.Anders Carlsson2011-01-252-1/+3
| | | | llvm-svn: 124201
* Be a bit more defensive about setting the temporary base locationDouglas Gregor2011-01-251-1/+3
| | | | | | | | during template instantiation. This code needs to eventually die, but this little tweak fixes PR8629, where bad location information slipped through to the location of a class template instantiation. llvm-svn: 124199
* Implement the rvalue-reference deduction transformation (from T&& ->Douglas Gregor2011-01-251-6/+33
| | | | | | | | T) when taking the address of an overloaded function or matching a specialization to a template (C++0x [temp.deduct.type]p10). Fixes PR9044. llvm-svn: 124197
* When performing a glvalue-to-xvalue static_cast that involves aDouglas Gregor2011-01-251-6/+17
| | | | | | | derived-to-base conversion, set the cast kind and base path appropriately. llvm-svn: 124189
* Add the ns_consumes_self, ns_consumed, cf_consumed, and ns_returns_autoreleasedJohn McCall2011-01-252-15/+93
| | | | | | attributes for the benefit of the static analyzer. llvm-svn: 124174
* Downgrade the error about rvalue references to an extension warningDouglas Gregor2011-01-252-3/+3
| | | | | | | | and turn on __has_feature(cxx_rvalue_references). The core rvalue references proposal seems to be fully implemented now, pending lots more testing. llvm-svn: 124169
* [analyzer] Handle the dot syntax for properties in the ExprEngine.Argyrios Kyrtzidis2011-01-256-11/+80
| | | | | | | | | | We translate property accesses to obj-c messages by simulating "loads" or "stores" to properties using a pseudo-location SVal kind (ObjCPropRef). Checkers can now reason about obj-c messages for both explicit message expressions and implicit messages due to property accesses. llvm-svn: 124161
* [analyzer] Introduce ExprEngine::VisitObjCMessage for handling general ↵Argyrios Kyrtzidis2011-01-251-12/+19
| | | | | | | | ObjCMessages (both message expressions and property access) and use it in ExprEngine::VisitObjCMessageExpr. llvm-svn: 124160
* [analyzer] Introduce ObjCMessage which represents both explicit ObjC message ↵Argyrios Kyrtzidis2011-01-258-171/+289
| | | | | | | | | | expressions and implicit messages that are sent for handling properties in dot syntax. Replace all direct uses of ObjCMessageExpr in the checkers and checker interface with ObjCMessage. llvm-svn: 124159
* In a ObjCMessageExpr with the super class as receiver, 'super' is actually a ↵Argyrios Kyrtzidis2011-01-251-3/+3
| | | | | | ObjCInterfaceType. llvm-svn: 124158
* [analyzer] Simplify GetReceiverType function in ↵Argyrios Kyrtzidis2011-01-251-18/+2
| | | | | | BasicObjCFoundationChecks.cpp; no functionality change. llvm-svn: 124157
* Revert r124146 for now. It appears to be failing on a few platforms.Eric Christopher2011-01-242-50/+23
| | | | llvm-svn: 124153
* pre/post increase/decrease for AltiVec vectorsAnton Yartsev2011-01-242-23/+50
| | | | llvm-svn: 124146
* Enhance the diagnostic for referring to a typedef with an elaborated name to beNick Lewycky2011-01-241-3/+22
| | | | | | as useful in a templated context as it is without templates. Fixes PR8755! llvm-svn: 124136
* Disallow function template partial specializations, from HansDouglas Gregor2011-01-241-2/+4
| | | | | | Wennborg! Fixes PR8295. llvm-svn: 124135
* Improve the printing of C++ construction expressions, from Yuri Gribov!Douglas Gregor2011-01-241-7/+8
| | | | llvm-svn: 124123
* Use attributes for all the override control specifiers.Anders Carlsson2011-01-249-28/+15
| | | | llvm-svn: 124122
OpenPOWER on IntegriCloud