summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple bugs:Ted Kremenek2009-01-302-0/+39
| | | | | | | | | | | | | | - NonLoc::MakeVal() would use sizeof(unsigned) (literally) instead of consulting ASTContext for the size (in bits) of 'int'. While it worked, it was a conflation of concepts and using ASTContext.IntTy is 100% correct. - RegionStore::getSizeInElements() no longer assumes that a VarRegion has the type "ConstantArray", and handles the case when uses use ordinary variables as if they were arrays. - Fixed ElementRegion::getRValueType() to just return the rvalue type of its "array region" in the case the array didn't have ArrayType. - All of this fixes <rdar://problem/6541136> llvm-svn: 63347
* retain/release checker: When generating summaries for CF/CG functions, allow ↵Ted Kremenek2009-01-291-0/+31
| | | | | | arguments to "escape" if they are passed to a function containing the terms "InsertValue", "SetValue", or "AddValue". This fixes <rdar://problem/6539791>. llvm-svn: 63341
* Make CodeGen produce an error if we come across a non-constant initializer ↵Douglas Gregor2009-01-291-5/+4
| | | | | | list that involves the GNU array-range designator extension llvm-svn: 63327
* Introduce a new expression node, ImplicitValueInitExpr, thatDouglas Gregor2009-01-291-0/+17
| | | | | | | | | | | | | represents an implicit value-initialization of a subobject of a particular type. This replaces the (ab)use of CXXZeroValueInitExpr within initializer lists for the "holes" that occur due to the use of C99 designated initializers. The new test case is currently XFAIL'd, because CodeGen's ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be taught to value-initialize when it sees ImplicitValueInitExprs. llvm-svn: 63317
* Evaluate ==,!= for complex types.Daniel Dunbar2009-01-291-3/+28
| | | | llvm-svn: 63280
* Add another devilish testcase for designated initializersDouglas Gregor2009-01-291-1/+6
| | | | llvm-svn: 63262
* Eliminate infinite looping in a wacky case with designated initializers. ↵Douglas Gregor2009-01-291-1/+9
| | | | | | Simplifies (somewhat) the actually checking of the initializer expression following the designators llvm-svn: 63257
* Improvements to code-generation and semantic analysis of designatedDouglas Gregor2009-01-281-5/+5
| | | | | | | | | | | | initializers. - We now initialize unions properly when a member other than the first is named by a designated initializer. - We now provide proper semantic analysis and code generation for GNU array-range designators *except* that side effects will occur more than once. We warn about this. llvm-svn: 63253
* Implement basic _Complex integer constant folding.Daniel Dunbar2009-01-281-0/+3
| | | | | | | - Merged into single ComplexEvaluator, these share too much logic to be worth splitting for float/int (IMHO). Will split on request. llvm-svn: 63248
* Code generation support for C99 designated initializers.Douglas Gregor2009-01-283-7/+63
| | | | | | | | | | | | | | | | | | | | The approach I've taken in this patch is relatively straightforward, although the code itself is non-trivial. Essentially, as we process an initializer list we build up a fully-explicit representation of the initializer list, where each of the subobject initializations occurs in order. Designators serve to "fill in" subobject initializations in a non-linear way. The fully-explicit representation makes initializer lists (both with and without designators) easy to grok for codegen and later semantic analyses. We keep the syntactic form of the initializer list linked into the AST for those clients interested in exactly what the user wrote. Known limitations: - Designating a member of a union that isn't the first member may result in bogus initialization (we warn about this) - GNU array-range designators are not supported (we warn about this) llvm-svn: 63242
* retain/release checker: Always generate an "autorelease" summary for an ↵Ted Kremenek2009-01-281-0/+81
| | | | | | "autorelease" message, and have the summary processing logic treat it as a no-op in GC mode. This change is motivated to encode more of the semantics in the summaries themselves for eventual better diagnostics. llvm-svn: 63241
* Handle complex types in ASTContext::mergeTypesDaniel Dunbar2009-01-281-0/+9
| | | | llvm-svn: 63238
* Add autorelease test case.Ted Kremenek2009-01-281-0/+7
| | | | llvm-svn: 63237
* Implement pointer to member handling in static_cast.Sebastian Redl2009-01-282-1/+14
| | | | | | | Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same. Make a few style corrections as suggested by Chris. llvm-svn: 63215
* Complete semantic checking for typedef redeclarations in C++. TheDouglas Gregor2009-01-282-3/+24
| | | | | | | rules are slightly different than in C, and now we handle both dialects properly. llvm-svn: 63211
* retain/release checker: Improve diagnostics to indicate that CF objects are ↵Ted Kremenek2009-01-281-1/+7
| | | | | | not automatically garbage collected. llvm-svn: 63187
* fix a crash I introduced, thanks to Ted for the awesome reducedChris Lattner2009-01-281-0/+5
| | | | | | testcase :) llvm-svn: 63182
* add test for PR2502, which was already fixed some time agoNuno Lopes2009-01-281-0/+3
| | | | llvm-svn: 63160
* fix PR3427: fix debuginfo for incomplete array typesNuno Lopes2009-01-281-1/+7
| | | | llvm-svn: 63158
* Add handling of member pointers to reinterpret_cast.Sebastian Redl2009-01-271-0/+18
| | | | llvm-svn: 63150
* If an input constraint refers to an output constraint, it should have the ↵Anders Carlsson2009-01-272-5/+6
| | | | | | same constraint info as the output constraint. Fixes PR3417 llvm-svn: 63127
* eliminate some random .ll file outputsChris Lattner2009-01-2712-12/+12
| | | | llvm-svn: 63117
* Fix bug in BasicStore::getLValueElement where if the base of an array ↵Ted Kremenek2009-01-271-0/+8
| | | | | | | | subscript expression was an ElementRegion we stacked another ElementRegion on top of that. This fixes PR 3422. llvm-svn: 63110
* Fix for PR3418: make sure to handle the RHS of expressions starting with Eli Friedman2009-01-271-0/+4
| | | | | | __extension__. This sort of construct shows up in the gcc source code. llvm-svn: 63100
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-271-1/+1
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* Fix a bug that I noticed by inspection.Chris Lattner2009-01-271-0/+9
| | | | llvm-svn: 63094
* Fix definition of __builtin_ia32_vec_set_v2di and de-XFAILDaniel Dunbar2009-01-261-5/+4
| | | | | | builtins-x86.c. llvm-svn: 63069
* Add support for member pointers to const_cast.Sebastian Redl2009-01-261-0/+7
| | | | llvm-svn: 63055
* Remove an implemented FIXME and extend test cases. Follow-up on Doug's review.Sebastian Redl2009-01-261-0/+7
| | | | llvm-svn: 63032
* add parsing and constraint enforcement for GNU line marker directives.Chris Lattner2009-01-261-0/+13
| | | | llvm-svn: 63003
* add another sanity test.Chris Lattner2009-01-261-0/+4
| | | | llvm-svn: 63001
* parse and enforce required constraints on #line directives. Right nowChris Lattner2009-01-261-0/+10
| | | | | | we just discard them. llvm-svn: 62999
* Implement implicit conversions for pointers-to-member.Sebastian Redl2009-01-252-0/+25
| | | | llvm-svn: 62971
* Make the constant folder aware of Eli Friedman2009-01-251-1/+3
| | | | | | | __builtin___CFStringMakeConstantString. (We get into trouble in GenerateStaticBlockVarDecl if the constant folder isn't accurate.) llvm-svn: 62949
* Fix the address of a label to be properly considered and emitted as aEli Friedman2009-01-251-0/+4
| | | | | | constant. llvm-svn: 62948
* Fix for PR2100: merge types for variables.Eli Friedman2009-01-241-0/+16
| | | | llvm-svn: 62947
* Correct test; sorry for any inconvenience.Eli Friedman2009-01-241-1/+1
| | | | llvm-svn: 62946
* Make tentative parsing of pointer-to-member decls work, and fix other stuff ↵Sebastian Redl2009-01-241-0/+5
| | | | | | pointed out by Doug. llvm-svn: 62944
* PR3062: statement expressions should be illegal at file scope. I don't Eli Friedman2009-01-241-0/+2
| | | | | | | think this has any significant effects at the moment, but it could matter if we start constant-folding statement expressions like gcc does. llvm-svn: 62943
* Fix for PR2910: implement CodeGen for non-constant offsetof.Eli Friedman2009-01-241-0/+12
| | | | | | Note that there are still other issues in this area; see PR3396. llvm-svn: 62942
* Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)Chris Lattner2009-01-241-2/+5
| | | | llvm-svn: 62936
* Add support for declaring pointers to members.Sebastian Redl2009-01-241-0/+14
| | | | | | Add serialization support for ReferenceType. llvm-svn: 62934
* Fix PR3386 by handling GCC's rules for alignof, which are substantiallyChris Lattner2009-01-241-0/+9
| | | | | | different than those for sizeof. Reject alignof(bitfield) like gcc does. llvm-svn: 62928
* Fix invalid evaluation of _Complex float (real & imaginary parts hadDaniel Dunbar2009-01-241-0/+3
| | | | | | | mismatched semantics). - Enforce this in APValue. llvm-svn: 62924
* Handle the 'e' constraint. Fixes PR3385Anders Carlsson2009-01-241-0/+6
| | | | llvm-svn: 62923
* Ignore parens when determining if an expr is a string literal. Fixes PR3382.Anders Carlsson2009-01-241-0/+2
| | | | llvm-svn: 62922
* Fix crash ElementRegion::getRValueType() when the RvalueType of the ↵Ted Kremenek2009-01-241-1/+13
| | | | | | ArrayRegion is a typedef and not (directly) a pointer. llvm-svn: 62909
* More hacking on static analyzer diagnostics. When emitting summary ↵Ted Kremenek2009-01-242-3/+3
| | | | | | diagnostics the code paths for diagnostics involving paths or single locations are now unified. This patch also constifies many arguments/methods that are touched by this logic, leading to a nice overall code cleanup. llvm-svn: 62903
* More APSInt appeasementDouglas Gregor2009-01-231-1/+1
| | | | llvm-svn: 62884
* Hopefully the last of the APSInt signedness issues with initializers. Fixes ↵Douglas Gregor2009-01-231-1/+2
| | | | | | PR clang/3378 llvm-svn: 62876
OpenPOWER on IntegriCloud