summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a problem in the GCC testsuite, exposed by r150557. Compound literalsRichard Smith2012-02-181-2/+7
| | | | | | | are represented as prvalues in C++; don't be fooled into thinking they're global lvalues. llvm-svn: 150870
* Add a bunch of missing calls to DiagnoseSentinelCalls. ↵Eli Friedman2012-02-183-0/+14
| | | | | | | | <rdar://problem/10885993>. This should probably be refactored... but it isn't completely obvious what refactoring is best. llvm-svn: 150869
* Change wording of warning about using __bridge casts in non-ARC.Ted Kremenek2012-02-181-1/+1
| | | | llvm-svn: 150868
* Diagnose uses of deleted destructors and inaccessible defaulted destructors.Richard Smith2012-02-182-14/+23
| | | | | | | | | | We had two separate issues here: firstly, varions functions were assuming that they did not need to perform semantic checks on trivial destructors (this is not true in C++11, where a trivial destructor can nonetheless be private or deleted), and a bunch of DiagnoseUseOfDecl calls were missing for uses of destructors. llvm-svn: 150866
* Initial refactoring of 'ShouldDeleteSpecialMember', in preparation for providingRichard Smith2012-02-182-612/+307
| | | | | | | | | decent diagnostics. Finish the work of combining all the 'ShouldDelete' functions into one. In unifying the code, fix a minor bug where an anonymous union with a deleted default constructor as a member of a union wasn't being considered as making the outer union's default constructor deleted. llvm-svn: 150862
* Fix comment.Chad Rosier2012-02-181-1/+1
| | | | llvm-svn: 150859
* Add in a caching mechanism so that forward declarations are replacedEric Christopher2012-02-182-9/+38
| | | | | | | | with full types if they exist. rdar://10809898 and rdar://10209967 and rdar://10400981 llvm-svn: 150858
* Formatting.Eric Christopher2012-02-181-2/+1
| | | | llvm-svn: 150857
* Remove UpdateCompletedType from the debug info emission. We nowEric Christopher2012-02-183-20/+0
| | | | | | | emit less than complete types on purpose on occasion and so our caches aren't useful for this kind of lazy emitting. llvm-svn: 150856
* Remove redundant check.Chad Rosier2012-02-181-3/+2
| | | | llvm-svn: 150855
* Have conjured symbols depend on LocationContext, to add context sensitivity ↵Ted Kremenek2012-02-1711-44/+59
| | | | | | for functions called more than once. llvm-svn: 150849
* [analyzer] Fix another false positive in the Malloc Checker, by makingAnna Zaks2012-02-173-0/+29
| | | | | | | | | | | | it aware of CString APIs that return the input parameter. Malloc Checker needs to know how the 'strcpy' function is evaluated. Introduce the dependency on CStringChecker for that. CStringChecker knows all about these APIs. Addresses radar://10864450 llvm-svn: 150846
* [analyzer] Generalize function name checking in CString checker.Anna Zaks2012-02-172-26/+46
| | | | | | | (Ex: It was not treating __inline_strcpy as strcpy. Will add tests that rely on this later on.) llvm-svn: 150845
* modern objc translator: postpone writing of class definitionsFariborz Jahanian2012-02-171-16/+21
| | | | | | until the end when all their ivars are known then. llvm-svn: 150844
* modern objc writer: more work for category metadata rewriteFariborz Jahanian2012-02-171-6/+20
| | | | | | and some cleanup. llvm-svn: 150839
* Don't emit optimization-specific intrinsic at -O0.Richard Smith2012-02-171-0/+4
| | | | llvm-svn: 150838
* modern objc translator: category metadata relatedFariborz Jahanian2012-02-171-70/+118
| | | | | | patch. llvm-svn: 150825
* On Solaris, define some standard macros that the Solaris headers require inDavid Chisnall2012-02-171-0/+4
| | | | | | order to not be broken (by Solaris standards). llvm-svn: 150822
* De-nest tentative parsing to disambiguate lambdas from designators; noDouglas Gregor2012-02-171-42/+45
| | | | | | functionality change. llvm-svn: 150817
* Don't allow non-empty ParenListExprs as array-new initializers.Sebastian Redl2012-02-171-5/+2
| | | | | | Don't know what I was thinking there. Fixes PR12023. llvm-svn: 150804
* Basic code generation support for std::initializer_list.Sebastian Redl2012-02-175-135/+271
| | | | | | | | | | | | | | | | | | | | | | | We now generate temporary arrays to back std::initializer_list objects initialized with braces. The initializer_list is then made to point at the array. We support both ptr+size and start+end forms, although the latter is untested. Array lifetime is correct for temporary std::initializer_lists (e.g. call arguments) and local variables. It is untested for new expressions and member initializers. Things left to do: Massively increase the amount of testing. I need to write tests for start+end init lists, temporary objects created as a side effect of initializing init list objects, new expressions, member initialization, creation of temporary objects (e.g. std::vector) for initializer lists, and probably more. Get lifetime "right" for member initializers and new expressions. Not that either are very useful. Implement list-initialization of array new expressions. llvm-svn: 150803
* The clang half of r150794: after the construction of a global or static constRichard Smith2012-02-171-1/+17
| | | | | | | | variable ends, if the variable has a trivial destructor and no mutable subobjects then emit an llvm.invariant.start call for it. globalopt knows to make the variable const when evaluating this. llvm-svn: 150798
* Index "12" holds the vtable, not "9".Eric Christopher2012-02-171-1/+1
| | | | | | Fixes lots of gdb testsuite failures. llvm-svn: 150797
* Bug fix: do not emit static const local variables with mutable membersRichard Smith2012-02-173-30/+30
| | | | | | | | | as constants. Refactor and simplify all the separate checks for whether a type can be emitted as a constant. llvm-svn: 150793
* When performing IRGen on a global, emit it as a constant if:Richard Smith2012-02-171-1/+0
| | | | | | | | | | | 1) It has a const-qualified type, and 2) It has no mutable members, and 3) It has no dynamic initialization, and 4) It has trivial destruction. Remove the unnecessary requirement that the type be POD. This allows us to mark all constexpr objects with no mutable members as 'constant'. llvm-svn: 150792
* Only add 'const' to the type of variables captured in a lambda whenDouglas Gregor2012-02-171-2/+7
| | | | | | we're capturing it by value in a non-mutable lambda. llvm-svn: 150791
* Disambiguate between C++11 lambda expressions and C99 arrayDouglas Gregor2012-02-171-9/+80
| | | | | | | | | designators in the parser. In the worst case, this disambiguation requires tentative parsing just past the closing ']', but for most cases we'll be able to tell by looking ahead just one token (without going into the heavyweight tentative parsing machinery). llvm-svn: 150790
* Make sure all remaining parts of the constant evaluator are aware that an arrayRichard Smith2012-02-171-46/+35
| | | | | | can be represented by an LValue, and use that to simplify the code a little. llvm-svn: 150789
* Whether an argument is required (in contrast with being anJohn McCall2012-02-1722-417/+671
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Block expressions always have a prototyped function type; expose thisJohn McCall2012-02-171-3/+4
| | | | | | in the AST accessor and micro-optimize it very slightly. llvm-svn: 150787
* Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor2012-02-176-69/+95
| | | | | | | | | | | | | | | | | | | | conversion to function pointer. Rather than having IRgen synthesize the body of this function, we instead introduce a static member function "__invoke" with the same signature as the lambda's operator() in the AST. Sema then generates a body for the conversion to function pointer which simply returns the address of __invoke. This approach makes it easier to evaluate a call to the conversion function as a constant, makes the linkage of the __invoke function follow the normal rules for member functions, and may make life easier down the road if we ever want to constexpr'ify some of lambdas. Note that IR generation is responsible for filling in the body of __invoke (Sema just adds a dummy body), because the body can't generally be expressed in C++. Eli, please review! llvm-svn: 150783
* Reject continue/break statements within members of local functions nested withinRichard Smith2012-02-174-16/+25
| | | | | | | | | | | | | | | loop and switch statements, by teaching Scope that a function scope never has a continue/break parent for the purposes of control flow. Remove the hack in block and lambda expressions which worked around this by pretending that such expressions were continue/break scopes. Remove Scope::ControlParent, since it's unused. In passing, teach default statements to recover properly from a missing ';', and add a fixit for same to both default and case labels (the latter already recovered correctly). llvm-svn: 150776
* PR12012: Fix a regression in r150419 where we would try (and fail) toRichard Smith2012-02-171-0/+5
| | | | | | | zero-initialize class types with virtual bases when constant-evaluating an initializer. llvm-svn: 150770
* objective-c translator. More stuff for modern meta-data.Fariborz Jahanian2012-02-171-81/+11
| | | | llvm-svn: 150767
* Reapply r150631:Eric Christopher2012-02-162-103/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Add a completed/incomplete type difference. This allows us to have partial types for contexts and forward decls while allowing us to complete types later on for debug purposes. This piggy-backs on the metadata replacement and rauw changes for temporary nodes and takes advantage of the incremental support I added in earlier. This allows us to, if we decide, to limit adding methods and variables to structures in order to limit the amount of debug information output into a .o file. The caching is a bit complicated though so any thoughts on untangling that are welcome." with a fix: - Remove all RAUW during type construction by adding stub versions of types that we later complete. and some TODOs: - Add an RAUW cache for forward declared types so that we can replace them at the end of compilation. - Remove the code that updates on completed types because we no longer need to have that happen. We emit incomplete types on purpose and only want to know when we want to complete them. llvm-svn: 150752
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-14/+0
| | | | llvm-svn: 150738
* Avoid infinite mutual recursion in DiagnoseInvalidRedeclaration.Kaelyn Uhrain2012-02-161-2/+18
| | | | | | | | Don't try to typo-correct a method redeclaration to declarations not in the current record as it could lead to infinite recursion if CorrectTypo finds more than one correction candidate in a parent record. llvm-svn: 150735
* [analyzer] Malloc Checker: Clean up bug naming:Anna Zaks2012-02-161-15/+13
| | | | | | | - Rename the category "Logic Error" -> "Memory Error". - Shorten all the messages. llvm-svn: 150733
* [analyzer] Malloc Checker: Make the diagnostic visitor handle the caseAnna Zaks2012-02-161-22/+74
| | | | | | of failing realloc. + Minor cleanups. llvm-svn: 150732
* Pacify gcc's -Wreturn-typeMatt Beaumont-Gay2012-02-161-0/+1
| | | | llvm-svn: 150731
* fix the property list metadata name.Fariborz Jahanian2012-02-161-2/+2
| | | | llvm-svn: 150728
* Improve recovery for lambda expressions that have 'mutable' or aDouglas Gregor2012-02-161-0/+46
| | | | | | | trailing return type but not a '()'. Recover by inserting the parentheses. Thanks to Xeo on IRC for the example. llvm-svn: 150727
* modern objective-c translator: write the root class meta-data.Fariborz Jahanian2012-02-161-2/+74
| | | | llvm-svn: 150726
* Lambda closure types are always considered to be like "local" classes,Douglas Gregor2012-02-162-3/+7
| | | | | | | | | even if they are not within a function scope. Teach template instantiation to treat them as such, and make sure that we have a local instantiation scope when instantiating default arguments and static data members. llvm-svn: 150725
* Add checker visitation hooks in ExprEngine::Visit() for common no-op ↵Ted Kremenek2012-02-161-2/+7
| | | | | | expressions. To be used later. llvm-svn: 150723
* Revert "Move ExplodedNode reclaimation out of ExprEngine and into ↵Ted Kremenek2012-02-163-12/+20
| | | | | | CoreEngine. Also have it based on adding predecessors/successors, not node allocation. No measurable performance change." llvm-svn: 150722
* C++11 allows unions to have static data members. Remove the correspondingRichard Smith2012-02-161-7/+11
| | | | | | restriction and add some tests. llvm-svn: 150721
* Move ExplodedNode reclaimation out of ExprEngine and into CoreEngine. Also ↵Ted Kremenek2012-02-163-20/+12
| | | | | | have it based on adding predecessors/successors, not node allocation. No measurable performance change. llvm-svn: 150720
* Minor cleanup to node data structures in ExplodedGraph. No functionality ↵Ted Kremenek2012-02-162-36/+17
| | | | | | change. llvm-svn: 150719
* modern objc translator: meta-data generation for firstFariborz Jahanian2012-02-161-22/+68
| | | | | | part of class meta-data. llvm-svn: 150714
OpenPOWER on IntegriCloud