summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing the return type information for objc_sync_enter and objc_sync_exit. ↵Aaron Ballman2012-09-062-6/+6
| | | | | | Patch thanks to Joe Ranieri! llvm-svn: 163330
* c: make __attribute__((unused)) transitive.Fariborz Jahanian2012-09-061-1/+13
| | | | | | | Don't warn if annotated decl is used inside another unused. // rdar://12233989 llvm-svn: 163329
* Tighten up regexps some more.Jakob Stoklund Olesen2012-09-061-4/+4
| | | | | | | These tests were failing for me because the .* was greedily matching up to the /libexec/ld-elf.so.1" later on the same line. llvm-svn: 163328
* PR13775: When checking for a tag type being shadowed by some other declaration,Richard Smith2012-09-061-0/+14
| | | | | | don't trample over the caller's LookupResult in the case where the check fails. llvm-svn: 163281
* [analyzer] Enhance the member expr tracking to account for references.Anna Zaks2012-09-051-0/+16
| | | | | | As per Jordan's suggestion. (Came out of code review for r163261.) llvm-svn: 163269
* Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.Jordan Rose2012-09-051-0/+181
| | | | | | | | | | | | | | | These types are defined differently on 32-bit and 64-bit platforms, and trying to offer a fixit for one platform would only mess up the format string for the other. The Apple-recommended solution is to cast to a type that is known to be large enough and always use that to print the value. This should only have an impact on compile time if the format string is incorrect; in cases where the format string matches the definition on the current platform, no warning will be emitted. <rdar://problem/9135072&12164284> llvm-svn: 163266
* [analyzer] Always include destructors in the analysis CFG.Jordan Rose2012-09-055-4/+29
| | | | | | | | | | | | | | | | | | | | | While destructors will continue to not be inlined (unless the analyzer config option 'c++-inlining' is set to 'destructors'), leaving them out of the CFG is an incomplete model of the behavior of an object, and can cause false positive warnings (like PR13751, now working). Destructors for temporaries are still not on by default, since (a) we haven't actually checked this code to be sure it's fully correct (in particular, we probably need to be very careful with regard to lifetime-extension when a temporary is bound to a reference, C++11 [class.temporary]p5), and (b) ExprEngine doesn't actually do anything when it sees a temporary destructor in the CFG -- not even invalidate the object region. To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which controlled all implicit destructors, has been removed. llvm-svn: 163264
* [analyzer] Fix a crash PR13762.Anna Zaks2012-09-051-0/+6
| | | | llvm-svn: 163262
* [analyzer] NullOrUndef diagnostics: track symbols binded to regions.Anna Zaks2012-09-051-0/+354
| | | | | | | | | If a region is binded to a symbolic value, we should track the symbol. (The code I changed was not previously exercised by the regression tests.) llvm-svn: 163261
* Add test missed in previous commit.Eric Christopher2012-09-051-0/+56
| | | | llvm-svn: 163253
* Try to fix the windows bots.Eric Christopher2012-09-051-4/+4
| | | | llvm-svn: 163252
* Apply some driver improvements for freebsd-*-mips*.Eric Christopher2012-09-051-1/+29
| | | | | | Patch by Brooks Davis. llvm-svn: 163249
* Thread-safety analysis: bugfix for case where a trylock occurs in anDeLesley Hutchins2012-09-051-0/+27
| | | | | | expression involving temporaries. llvm-svn: 163237
* objective-c++11: c++11 does not change pod-ness whenFariborz Jahanian2012-09-051-0/+12
| | | | | | | | type is an unqualified objc pointer in arc. Treat it just as being treated in c++98. This fixes a bogus vararg warning with -std=c++11. //rdar://12229679 llvm-svn: 163236
* Update for r163231.Chad Rosier2012-09-051-16/+16
| | | | llvm-svn: 163232
* Added missing test.Abramo Bagnara2012-09-051-0/+2
| | | | llvm-svn: 163226
* c error recovery. treat an invalid redeclarationFariborz Jahanian2012-09-051-0/+9
| | | | | | | | of a c-function for what it is. Otherwise, this func is treated as an overloadable c-function resulting in a crash much later. // rdar://11743706 llvm-svn: 163224
* [analyzer] Fix bad test from r163220.Jordan Rose2012-09-051-0/+6
| | | | | | Add a FIXME to the test while I track down the real problem. llvm-svn: 163222
* [analyzer] Be more forgiving about calling methods on struct rvalues.Jordan Rose2012-09-052-9/+94
| | | | | | | | | | | | | | | | | | | | The problem is that the value of 'this' in a C++ member function call should always be a region (or NULL). However, if the object is an rvalue, it has no associated region (only a conjured symbol or LazyCompoundVal). For now, we handle this in two ways: 1) Actually respect MaterializeTemporaryExpr. Before, it was relying on CXXConstructExpr to create temporary regions for all struct values. Now it just does the right thing: if the value is not in a temporary region, create one. 2) Have CallEvent recognize the case where its 'this' pointer is a non-region, and just return UnknownVal to keep from confusing clients. The long-term problem is being tracked internally in <rdar://problem/12137950>, but this makes many test cases pass. llvm-svn: 163220
* Revert "[analyzer] Treat all struct values as regions (even rvalues)."Jordan Rose2012-09-052-92/+9
| | | | | | | | | | | | | | This turned out to have many implications, but what eventually seemed to make it unworkable was the fact that we can get struct values (as LazyCompoundVals) from other places besides return-by-value function calls; that is, we weren't actually able to "treat all struct values as regions" consistently across the entire analyzer core. Hopefully we'll be able to come up with an alternate solution soon. This reverts r163066 / 02df4f0aef142f00d4637cd851e54da2a123ca8e. llvm-svn: 163218
* [ms-inline asm] Update test case for r163181.Chad Rosier2012-09-051-16/+16
| | | | llvm-svn: 163182
* [ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. ThisChad Rosier2012-09-041-16/+16
| | | | | | | implementation does not co-exist well with how the sideeffect and alignstack attributes are handled. llvm-svn: 163173
* [analyzer] Don't use makeIntVal to create a floating-point value.Jordan Rose2012-09-041-0/+8
| | | | | | | | | | SimpleSValBuilder processes a couple trivial identities, including 'x - x' and 'x ^ x' (both 0). However, the former could appear with arguments of floating-point type, and we weren't checking for that. This started triggering an assert with r163069, which checks that a constant value is actually going to be used as an integer or pointer. llvm-svn: 163159
* Revert r163083 per chandlerc's request.Joao Matos2012-09-041-6/+0
| | | | llvm-svn: 163149
* Revert r163078 per chandlerc's request.Joao Matos2012-09-041-7/+5
| | | | llvm-svn: 163145
* [ms-inline asm] The MCInstrDesc only tracks register definitions. For now,Chad Rosier2012-09-041-2/+1
| | | | | | | assume that if the 1st operands is an expression and the instruction mayStore, then it is a memory definition. llvm-svn: 163144
* test/Driver/android-standalone.cpp: Fix test failure on Windowns, again.NAKAMURA Takumi2012-09-031-1/+1
| | | | llvm-svn: 163114
* Fix test failure on Windowns.Evgeniy Stepanov2012-09-031-1/+1
| | | | llvm-svn: 163112
* Follow-up on r163110 - forgot to commit some new tests...Timur Iskhodzhanov2012-09-031-0/+78
| | | | llvm-svn: 163111
* Fix PR13444 - wrong mangling of "const char * const *" and friends with ↵Timur Iskhodzhanov2012-09-032-9/+29
| | | | | | "-cxx-abi microsoft" llvm-svn: 163110
* Android standalone toolchain support.Evgeniy Stepanov2012-09-0316-8/+25
| | | | | | | | This change adds detection of C++ headers and libraries paths when building with the standalone toolchain from Android NDK. They are in a slightly unusual place. llvm-svn: 163109
* Rename ANDROIDEABI to Android.Logan Chien2012-09-021-0/+14
| | | | | | | | | | | | | Most of the code guarded with ANDROIDEABI are not ARM-specific, and having no relation with arm-eabi. Thus, it will be more natural to call this environment "Android" instead of "ANDROIDEABI". Note: We are not using ANDROID because several projects are using "-DANDROID" as the conditional compilation flag. llvm-svn: 163088
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-021-0/+6
| | | | | | Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review. llvm-svn: 163083
* Added a diagnostic for mismatched MS inheritance attributes. Also fixed the ↵Joao Matos2012-09-021-5/+7
| | | | | | incomplete type member pointer size calculation under the MS ABI. llvm-svn: 163078
* [libclang] Fix indexing type alias declarations. rdar://11878406Argyrios Kyrtzidis2012-09-011-0/+6
| | | | llvm-svn: 163072
* [libclang] The annotation of tokens operation visits statement nodes ↵Argyrios Kyrtzidis2012-09-011-0/+95
| | | | | | | | | | | | | | code-recursively. This can blow the stack with extremely deep hierarchies. Switch it to data-recursive. This is implemented by introducing a post-children visitation callback that the CursorVisitor is calling after child nodes of a cursor have been visited. This is used by the annotate-tokens visitor to do extra work at that point. rdar://11979525. llvm-svn: 163071
* [analyzer] Treat all struct values as regions (even rvalues).Jordan Rose2012-09-012-9/+92
| | | | | | | | | | | | | | | | | This allows us to correctly symbolicate the fields of structs returned by value, as well as get the proper 'this' value for when methods are called on structs returned by value. This does require a moderately ugly hack in the StoreManager: if we assign a "struct value" to a struct region, that now appears as a Loc value being bound to a region of struct type. We handle this by simply "dereferencing" the struct value region, which should create a LazyCompoundVal. This should fix recent crashes analyzing LLVM and on our internal buildbot. <rdar://problem/12137950> llvm-svn: 163066
* [analyzer] Always derive a CallEvent's return type from its origin expr.Jordan Rose2012-09-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we preferred to get a result type by looking at the callee's declared result type. This allowed us to handlereferences, which are represented in the AST as lvalues of their pointee type. (That is, a call to a function returning 'int &' has type 'int' and value kind 'lvalue'.) However, this results in us preferring the original type of a function over a casted type. This is a problem when a function pointer is casted to another type, because the conjured result value will have the wrong type. AdjustedReturnValueChecker is supposed to handle this, but still doesn't handle the case where there is no "original function" at all, i.e. where the callee is unknown. Now, we instead look at the call expression's value kind (lvalue, xvalue, or prvalue), and adjust the expr's type accordingly. This will have no effect when the function is inlined, and will conjure the value that will actually be used when it is not. This makes AdjustedReturnValueChecker /nearly/ unnecessary; unfortunately, the cases where it would still be useful are where we need to cast the result of an inlined function or a checker-evaluated function, and in these cases we don't know what we're casting /from/ by the time we can do post- call checks. In light of that, remove AdjustedReturnValueChecker, which was already not checking quite a few calls. llvm-svn: 163065
* don't warn about unused values when the unused value is a statement ↵Chris Lattner2012-08-311-0/+8
| | | | | | expression expanded from a macro. This is of dubious utility in general, but is specifically a major issue for the linux kernel. This resolves PR13747. llvm-svn: 163034
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-44/+44
| | | | llvm-svn: 163032
* Thread-safety analysis: fix handling of LOCK_RETURNED attribute so that theDeLesley Hutchins2012-08-311-0/+45
| | | | | | latest definition of a function is always used when computing lock expressions. llvm-svn: 163028
* Thread-safety analysis: fix handling of string constants in mutexDeLesley Hutchins2012-08-311-0/+26
| | | | | | expressions, which should be ignored right now. llvm-svn: 163026
* Normalize line endings of r163022.Joao Matos2012-08-311-1/+0
| | | | llvm-svn: 163023
* Emulate MSVC's preprocessor macro argument separator behavior by not ↵Joao Matos2012-08-311-0/+7
| | | | | | considering commas from nested macro expansions as argument separators. Fixes parsing of VS 2012 headers. llvm-svn: 163022
* objective-C ARC; detect and warn on retain cycle whenFariborz Jahanian2012-08-311-0/+4
| | | | | | | property-dot syntax is used on an object whose capture causes retain cycle. // rdar://11702054 llvm-svn: 163017
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-13/+21
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* [analyzer] RetainCountChecker: don't assume all functions have names.Jordan Rose2012-08-311-0/+19
| | | | | | | | | | | | | | | Fixes a hard-to-reach crash when calling a non-member overloaded operator with arguments that may be callbacks. Future-proofing: don't make the same assumption in MallocSizeofChecker. Aside from possibly respecting attributes in the future, it might be possible to call 'malloc' through a function pointer. I audited all other uses of FunctionDecl::getIdentifier() in the analyzer; they all now correctly test to see if the identifier is present before using it. llvm-svn: 163012
* [analyzer] Though C++ inlining is enabled, don't inline ctors and dtors.Jordan Rose2012-08-316-26/+23
| | | | | | | | | | | | | | | | More generally, this adds a new configuration option 'c++-inlining', which controls which C++ member functions can be considered for inlining. This uses the new -analyzer-config table, so the cc1 arguments will look like this: ... -analyzer-config c++-inlining=[none|methods|constructors|destructors] Note that each mode implies that all the previous member function kinds will be inlined as well; it doesn't make sense to inline destructors without inlining constructors, for example. The default mode is 'methods'. llvm-svn: 163004
* [analyzer] Ensure that PathDiagnostics profile the same regardless of path.Jordan Rose2012-08-311-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | PathDiagnostics are actually profiled and uniqued independently of the path on which the bug occurred. This is used to merge diagnostics that refer to the same issue along different paths, as well as by the plist diagnostics to reference files created by the HTML diagnostics. However, there are two problems with the current implementation: 1) The bug description is included in the profile, but some PathDiagnosticConsumers prefer abbreviated descriptions and some prefer verbose descriptions. Fixed by including both descriptions in the PathDiagnostic objects and always using the verbose one in the profile. 2) The "minimal" path generation scheme provides extra information about which events came from macros that the "extensive" scheme does not. This resulted not only in different locations for the plist and HTML diagnostics, but also in diagnostics being uniqued in the plist output but not in the HTML output. Fixed by storing the "end path" location explicitly in the PathDiagnostic object, rather than trying to find the last piece of the path when the diagnostic is requested. This should hopefully finish unsticking our internal buildbot. llvm-svn: 162965
* Change the representation of builtin functions in the ASTEli Friedman2012-08-313-13/+14
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
OpenPOWER on IntegriCloud