summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Support strlen() and __builtin_strlen() as constant expressions withDouglas Gregor2010-09-101-0/+4
| | | | | | | the call argument is a string literal. Fixes <rdar://problem/8413477>. llvm-svn: 113580
* Implement: <rdar://problem/6351970> rule request: warn if @synchronized ↵Ted Kremenek2010-09-101-0/+15
| | | | | | mutex can be nil llvm-svn: 113573
* Added AnalyzerStatsChecker, a path sensitive check that reports visitation ↵Tom Care2010-09-101-0/+14
| | | | | | statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project. llvm-svn: 113568
* Add libclang support for label statements, gotos, and taking theDouglas Gregor2010-09-105-24/+13
| | | | | | address of a label (GNU extension). llvm-svn: 113564
* Add libclang visitation for C99 designated initializers.Douglas Gregor2010-09-091-0/+10
| | | | llvm-svn: 113560
* Add libclang visitation for __builtin_offsetof's components (fieldsDouglas Gregor2010-09-091-0/+16
| | | | | | and array references). llvm-svn: 113556
* property reference expression used on lhs of assignmentFariborz Jahanian2010-09-092-0/+40
| | | | | | | | follows objective's semantics and is not overload'able with an assignment operator. Fixes a crash and a missing diagnostics. Radar 8379892. llvm-svn: 113555
* Clean up obtuse wording of checker diagnostic of using an uninitialized ↵Ted Kremenek2010-09-096-9/+9
| | | | | | | value in a function call. Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved llvm-svn: 113554
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-091-0/+15
| | | | | | | | spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes <rdar://problem/8412013>. llvm-svn: 113553
* Teach libclang to walk the base and member initializers of aDouglas Gregor2010-09-092-9/+31
| | | | | | | | constructor, in source order. Also introduces a new reference kind for class members, which is used here (for member initializers) and will also be used for designated initializers and offsetof. llvm-svn: 113545
* Use FindReportInEquivalenceClass to identify all the nodes used for the ↵Ted Kremenek2010-09-091-1/+259
| | | | | | | | | | trimmed graph (in BugReporter). This fixes a problem where a leak that happened to occur on both an exit() path and a non-exit() path was getting reported with the exit() path (which users don't care about). This fixes: <rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit()) llvm-svn: 113524
* Use temporary files for this test, to see if we can flush out an ↵Douglas Gregor2010-09-091-3/+6
| | | | | | inexplicable error on Windows llvm-svn: 113493
* Add proper type-source information to UnaryTypeTraitExpr, includingDouglas Gregor2010-09-091-0/+3
| | | | | | libclang visitation. llvm-svn: 113492
* Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().Ted Kremenek2010-09-094-5/+764
| | | | | | | | | | | | | | | | | The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained to be a constant value. This allows us to recover some path-sensitivity in some cases by lowering the required level of reasoning power needed to evaluate some expressions. The net win from this change is that the false positive in PR 8015 is fixed, and we also find more idempotent operations bugs. We do, however, regress with the BugReporterVisitors, which need to be modified to understand this constant folding (and look past it). This causes some diagnostic regressions in plist-output.m which will get addressed in a future patch. plist-output.m is now marked XFAIL, while plist-output-alternate.m now tests that the plist output is working, but with the suboptimal diagnostics. This second test file will eventually be removed. llvm-svn: 113477
* Check format strings when a called function has more than one FormatAttr ↵Ted Kremenek2010-09-091-1/+10
| | | | | | (one for 'scanf' and one for 'printf'). Fixes <rdar://problem/8409437>. llvm-svn: 113472
* It appears that technically a null format string is not warned under ↵Ted Kremenek2010-09-091-0/+7
| | | | | | | | -Wformat-nonliteral, as the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log). Fixes <rdar://problem/8269537>. llvm-svn: 113469
* Relax __attribute_((nonnull)) checking to allow the attribute on functions ↵Ted Kremenek2010-09-091-2/+2
| | | | | | | | with no pointer arguments. GCC doesn't warn in this case, and the attribute is trivially satisfied (and benign). Fixes <rdar://problem/8364828>. llvm-svn: 113464
* Include test case for <rdar://problem/5880430>.Ted Kremenek2010-09-091-0/+27
| | | | llvm-svn: 113458
* Block ivar layout must assume that the 'isa'Fariborz Jahanian2010-09-091-5/+5
| | | | | | | | field of the block descriptor is GC'able (scanned) as this what the runtime expects (one can send it messages). Radar 8394947. llvm-svn: 113454
* Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek2010-09-091-0/+16
| | | | | | | | statement live if a switch on an enum value has explicit 'case:' statements for each enum value. llvm-svn: 113451
* Enhance -Wreturn-type to not warn when control-flow is most likely limited ↵Ted Kremenek2010-09-091-0/+13
| | | | | | | | by a switch statement explicitly covering all the cases for an enum value. llvm-svn: 113450
* Add support for a few MS extensions supported by the Borland compilerDawn Perchik2010-09-081-0/+27
| | | | | | (__uuidof, _fastcall, etc.). llvm-svn: 113434
* When providing a completion for a function/method parameter of blockDouglas Gregor2010-09-081-4/+15
| | | | | | pointer type, actually provide a usable block literal expression. llvm-svn: 113431
* Test removed.Fariborz Jahanian2010-09-081-20/+0
| | | | llvm-svn: 113428
* Removed test case.Fariborz Jahanian2010-09-081-0/+0
| | | | llvm-svn: 113418
* Use the new-initialization code for initializing scalars with aDouglas Gregor2010-09-084-4/+7
| | | | | | | | function-style cast. Previously, we had a (redundant, incorrect) semantic-checking path for non-class types, which allowed value-initialization of a reference type and then crashed. llvm-svn: 113415
* Reverse r113397 until we decide what to do withFariborz Jahanian2010-09-081-20/+0
| | | | | | | use of 'struct objc_object*' for 'is' (and others) in clang. llvm-svn: 113414
* Fix a crash when overloading id with objc_object*.Fariborz Jahanian2010-09-082-0/+40
| | | | | | Radar 8400356. llvm-svn: 113397
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-1/+38
| | | | llvm-svn: 113356
* Allow type definitions inside anonymous struct/union in Microsoft mode.Francois Pichet2010-09-081-1/+43
| | | | llvm-svn: 113354
* Don't give 'global constructor' warnings for function statics, even if they ↵Sebastian Redl2010-09-081-1/+11
| | | | | | have a direct initializer. Fixes PR8095. llvm-svn: 113344
* Put the tautological-comparison-of-unsigned-against-zero warnings inJohn McCall2010-09-082-3/+3
| | | | | | | | | -Wtautological-compare instead of -Wsign-compare, which also implies turning them on by default. Restoration of r112877. llvm-svn: 113334
* Implement ARM static local initialization guards, which are more compact thanJohn McCall2010-09-083-3/+78
| | | | | | Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
* Allow (cv) void and incomplete arrays to be passed to the type traits.Sebastian Redl2010-09-082-4/+37
| | | | | | Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard. llvm-svn: 113326
* add a fixit when 'main' does ot return 'int'; review welcomeGabor Greif2010-09-081-0/+6
| | | | llvm-svn: 113324
* Provide proper type-source location information forDouglas Gregor2010-09-081-0/+20
| | | | | | | | CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the process. llvm-svn: 113319
* Local static block variable referecned in itsFariborz Jahanian2010-09-071-0/+57
| | | | | | | | block-literal initializer expression causes IRgen to crash. This patch fixes by saving it in StaticLocalDecl map already used for such purposes. (radar 8390455). llvm-svn: 113307
* tests: Use -ffreestanding when including stdint.h, to avoid platform ↵Daniel Dunbar2010-09-078-11/+11
| | | | | | dependencies. llvm-svn: 113301
* Improve source-location information for CXXNewExpr, by hanging on toDouglas Gregor2010-09-071-0/+15
| | | | | | the TypeSourceInfo for the allocated type. Fixes PR7501. llvm-svn: 113291
* Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) ↵Ted Kremenek2010-09-071-0/+6
| | | | | | and simplify surrounding checking logic. llvm-svn: 113282
* Re-enabled truncation/extension checking in IdempotentOperationChecker and ↵Tom Care2010-09-071-0/+7
| | | | | | added a test case. llvm-svn: 113269
* Have Sema check for validity of CGString literalFariborz Jahanian2010-09-072-4/+2
| | | | | | instead of asserting in IRGen. Fixes radar 8390459. llvm-svn: 113253
* Improve error recovery when we see ':' and expect a ';'.John McCall2010-09-072-1/+7
| | | | | | I, at least, make this typo all the time. llvm-svn: 113243
* Adjust a test that's expecting optimizations to be doneDale Johannesen2010-09-071-3/+3
| | | | | | on MMX palignr; we don't do this for the intrinsics. llvm-svn: 113234
* Provide a specific diagnostic when trying to redefine an "externDouglas Gregor2010-09-071-0/+4
| | | | | | | inline" function outside of GNU89 mode. Fixes <rdar://problem/6880464>. llvm-svn: 113204
* Improve recovery when there is a stray ']' or ')' before the ';' atDouglas Gregor2010-09-071-14/+18
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Improve recovery when a comma is missing between enumerators in anDouglas Gregor2010-09-071-0/+7
| | | | | | enumeration definition. Fixes <rdar://problem/7159693>. llvm-svn: 113201
* Improve diagnostic and recovery when missing a comma between base orDouglas Gregor2010-09-071-0/+9
| | | | | | member initializers in a C++ constructor. Fixes <rdar://problem/7796492>. llvm-svn: 113199
* Due to asmparser improvements, this error message is now betterChris Lattner2010-09-061-1/+1
| | | | llvm-svn: 113177
* Fix a C++ PCH problem which was exposed by r113019. ↵Argyrios Kyrtzidis2010-09-062-0/+12
| | | | | | CXXBaseOrMemberInitializer's IsWritten and source order is not set. llvm-svn: 113161
OpenPOWER on IntegriCloud