summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[analyzer] Create a temporary region for rvalue structs when ↵Jordan Rose2012-09-293-20/+13
| | | | | | | | accessing fields" This reverts commit 6f61df3e7256413dcb99afb9673f4206e3c4992c. llvm-svn: 164877
* Revert "[analyzer] Create a temp region when a method is called on a struct ↵Jordan Rose2012-09-292-40/+22
| | | | | | | | rvalue." This reverts commit 0006ba445962621ed82ec84400a6b978205a3fbc. llvm-svn: 164876
* Revert "[analyzer] Handle inlined constructors for rvalue temporaries ↵Jordan Rose2012-09-293-22/+7
| | | | | | | | correctly." This reverts commit 580cd17f256259f39a382e967173f34d68e73859. llvm-svn: 164875
* For PPCallbacks::InclusionDirective() add a parameter for the module, wheneverArgyrios Kyrtzidis2012-09-299-25/+87
| | | | | | | an inclusion directive was automatically turned into a module import, and PPCallbacks::moduleImport() for an explicit module import. llvm-svn: 164874
* In the Module class, add a reference to the corresponding AST file.Argyrios Kyrtzidis2012-09-293-4/+22
| | | | llvm-svn: 164873
* Add an assertion to make sure the implicitly imported moduleArgyrios Kyrtzidis2012-09-291-0/+2
| | | | | | is the same as the suggested one when looking up the include filename. llvm-svn: 164872
* <rdar://problem/12378910> Fix a bunch of other places where similar problems ↵Enrico Granata2012-09-291-0/+23
| | | | | | could happen llvm-svn: 164871
* <rdar://problem/12378910> Fixing a potential crasher in the data formatters ↵Enrico Granata2012-09-291-0/+3
| | | | | | where we fail to check for NULL or empty class name llvm-svn: 164870
* [analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.Anna Zaks2012-09-291-1/+0
| | | | llvm-svn: 164869
* [analyzer] Re-implement IvarInvalidationChecker so that it verifies thatAnna Zaks2012-09-292-88/+309
| | | | | | | | | | | the validation occurred. The original implementation was pessimistic - we assumed that ivars which escape are invalidated. This version is optimistic, it assumes that the ivars will always be explicitly invalidated: either set to nil or sent an invalidation message. llvm-svn: 164868
* Add test case for r164850.Evan Cheng2012-09-291-0/+106
| | | | llvm-svn: 164867
* Do not delete BBs if their addresses are taken. rdar://12396696Evan Cheng2012-09-282-2/+56
| | | | llvm-svn: 164866
* Implementing plugins that provide commands.Enrico Granata2012-09-2822-13/+657
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
* PR13941: Mark all virtual functions as unnamed_addr. It's not possible toRichard Smith2012-09-283-3/+14
| | | | | | | observe their addresses (taking their address gives the vtable slot) so we are free to merge their definitions. llvm-svn: 164864
* Set up code under _LIBCXX_DYNAMIC_FALLBACK which is off by default. For a ↵Howard Hinnant2012-09-282-50/+129
| | | | | | full description of _LIBCXX_DYNAMIC_FALLBACK, see src/private_typeinfo.cpp. llvm-svn: 164863
* Use a custom DenseMapInfo for WeakObjectProfileTy.Jordan Rose2012-09-281-24/+28
| | | | | | | | | | We can't specialize the usual llvm::DenseMapInfo at the end of the file because by that point the DenseMap in FunctionScopeInfo has already been instantiated. No functionality change. llvm-svn: 164862
* [Doc parsing] Add availability information to generated Comment XML.Fariborz Jahanian2012-09-282-1/+92
| | | | | | | (I still need to add a test once I figure it out). Reviewed off-line by Doug. // rdar://12378879 llvm-svn: 164861
* Don't use bit-wise operations to query for inclusion/exclusion of attributes.Bill Wendling2012-09-281-14/+49
| | | | llvm-svn: 164860
* Fix buildbots by not using a template from another namespace.Jordan Rose2012-09-281-8/+7
| | | | | | | No need to specialize BeforeThanCompare for a comparator that's only going to be used once. llvm-svn: 164859
* Compatibility macro detection for the -Wimplicit-fallthrough diagnostic.Alexander Kornienko2012-09-287-15/+253
| | | | | | | | | | | | | | | | | | | Summary: When issuing a diagnostic message for the -Wimplicit-fallthrough diagnostics, always try to find the latest macro, defined at the point of fallthrough, which is immediately expanded to "[[clang::fallthrough]]", and use it's name instead of the actual sequence. Known issues: * uses PP.getSpelling() to compare macro definition with a string (anyone can suggest a convenient way to fill a token array, or maybe lex it in runtime?); * this can be generalized and used in other similar cases, any ideas where it should reside then? Reviewers: doug.gregor, rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D50 llvm-svn: 164858
* -Wreceiver-is-weak: rephrase warning text and add a suggestion Note.Jordan Rose2012-09-283-27/+30
| | | | | | | | | | | | New output: warning: weak property may be unpredictably set to nil note: property declared here note: assign the value to a strong variable to keep the object alive during use <rdar://problem/12277204> llvm-svn: 164857
* Pull ScopeInfo implementation into its own file.Jordan Rose2012-09-284-160/+184
| | | | | | | | | The infrastructure for -Warc-repeated-use-of-weak got a little too heavy to leave sitting at the top of Sema.cpp. No functionality change. llvm-svn: 164856
* -Warc-repeated-use-of-weak: check ivars and variables as well.Jordan Rose2012-09-289-101/+253
| | | | | | | | | | Like properties, loading from a weak ivar twice in the same function can give you inconsistent results if the object is deallocated between the two loads. It is safer to assign to a strong local variable and use that. Second half of <rdar://problem/12280249>. llvm-svn: 164855
* Add a warning (off by default) for repeated use of the same weak property.Jordan Rose2012-09-289-1/+679
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivating example: if (self.weakProp) use(self.weakProp); As with any non-atomic test-then-use, it is possible a weak property to be non-nil at the 'if', but be deallocated by the time it is used. The correct way to write this example is as follows: id tmp = self.weakProp; if (tmp) use(tmp); The warning is controlled by -Warc-repeated-use-of-receiver, and uses the property name and base to determine if the same property on the same object is being accessed multiple times. In cases where the base is more complicated than just a single Decl (e.g. 'foo.bar.weakProp'), it picks a Decl for some degree of uniquing and reports the problem under a subflag, -Warc-maybe-repeated-use-of-receiver. This gives a way to tune the aggressiveness of the warning for a particular project. The warning is not on by default because it is not flow-sensitive and thus may have a higher-than-acceptable rate of false positives, though it is less noisy than -Wreceiver-is-weak. On the other hand, it will not warn about some cases that may be legitimate issues that -Wreceiver-is-weak will catch, and it does not attempt to reason about methods returning weak values. Even though this is not a real "analysis-based" check I've put the bug emission code in AnalysisBasedWarnings for two reasons: (1) to run on every kind of code body (function, method, block, or lambda), and (2) to suggest that it may be enhanced by flow-sensitive analysis in the future. The second (smaller) half of this work is to extend it to weak locals and weak ivars. This should use most of the same infrastructure. Part of <rdar://problem/12280249> llvm-svn: 164854
* Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls forDan Gohman2012-09-286-1/+102
| | | | | | struct assignment. llvm-svn: 164853
* <rdar://problem/12398225>Greg Clayton2012-09-282-42/+46
| | | | | | Improve performance of StringExtractor::GetHexS8(). llvm-svn: 164852
* When processing an InitListExpr and skipping the initialization of an invalidRichard Smith2012-09-282-0/+8
| | | | | | | record, skip at least one element from the InitListExpr to avoid an infinite loop if we're initializing an array of unknown bound. llvm-svn: 164851
* GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. ↵Evan Cheng2012-09-281-4/+3
| | | | | | rdar://9142819 llvm-svn: 164850
* MIPS DSP: add operands to make sure instruction strings are being matched.Akira Hatanaka2012-09-282-23/+23
| | | | llvm-svn: 164849
* Remove unused methods.Bill Wendling2012-09-281-7/+1
| | | | llvm-svn: 164848
* docs: dedent list on index.rstSean Silva2012-09-281-23/+23
| | | | | | | | | In reStructuredText, indented blocks denote block quotes [1]. This list is not a block quote. [1]. http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes llvm-svn: 164847
* Fix -Wcovered-switch-default warning.Michael J. Spencer2012-09-281-2/+0
| | | | llvm-svn: 164846
* MIPS DSP: other miscellaneous instructions.Akira Hatanaka2012-09-284-0/+207
| | | | llvm-svn: 164845
* Fixed a bug where if something went wrong whileSean Callanan2012-09-281-0/+4
| | | | | | | | constructing the ObjCInterfaceDecl for an ISA, we'd continue and try to use that Decl anyway, possibly causing a crash. llvm-svn: 164844
* Update template type diffing to handle qualifiers. Differing qualifiers willRichard Trieu2012-09-283-0/+341
| | | | | | now be printed with highlighting. llvm-svn: 164843
* Testcase for r164835Manman Ren2012-09-281-0/+28
| | | | llvm-svn: 164842
* Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by ↵Richard Smith2012-09-283-0/+13
| | | | | | Tijl Coosemans! llvm-svn: 164841
* MIPS DSP: ADDUH.QB instruction sub-class.Akira Hatanaka2012-09-283-0/+312
| | | | llvm-svn: 164840
* Clean up part of template type diffing. Moved repeated code to separateRichard Trieu2012-09-281-32/+30
| | | | | | functions. Reworked one of the conditionals. No functional changes. llvm-svn: 164839
* Modern objcective-C translator. When doing rewriting, Do not Fariborz Jahanian2012-09-283-2/+5
| | | | | | | use the integrated pre-processor, preprocess in objective-c++ mode. // rdar://12189793. llvm-svn: 164836
* X86: when replacing SUB with TEST in ISelDAGToDAG, only replace uses of theManman Ren2012-09-281-5/+28
| | | | | | | | second output of SUB with first output of TEST. PR13966 llvm-svn: 164835
* Improve the diagnostic messages on dynamic_cast.Howard Hinnant2012-09-281-6/+6
| | | | llvm-svn: 164833
* Due to a mistake on my own part, I need to burn some version numbers. This ↵Howard Hinnant2012-09-281-1/+1
| | | | | | does not impact any of the implementation of libc++, and does not impact the ABI in any way. llvm-svn: 164832
* Removing dependency on third party library for Intel JIT event support.Andrew Kaylor2012-09-2815-376/+1285
| | | | | | Patch committed on behalf of Kirill Uhanov llvm-svn: 164831
* [analyzer] Handle inlined constructors for rvalue temporaries correctly.Jordan Rose2012-09-283-7/+22
| | | | | | | | | | | | | | | Previously the analyzer treated all inlined constructors like lvalues, setting the value of the CXXConstructExpr to the newly-constructed region. However, some CXXConstructExprs behave like rvalues -- in particular, the implicit copy constructor into a pass-by-value argument. In this case, we want only the /contents/ of a temporary object to be passed, so that we can use the same "copy each argument into the parameter region" algorithm that we use for scalar arguments. This may change when we start modeling destructors of temporaries, but for now this is the last part of <rdar://problem/12137950>. llvm-svn: 164830
* [analyzer] Create a temp region when a method is called on a struct rvalue.Jordan Rose2012-09-282-22/+40
| | | | | | | | | | | | | An rvalue has no address, but calling a C++ member function requires a 'this' pointer. This commit makes the analyzer create a temporary region in which to store the struct rvalue and use as a 'this' pointer whenever a member function is called on an rvalue, which is essentially what CodeGen does. More of <rdar://problem/12137950>. The last part is tracking down the C++ FIXME in array-struct-region.cpp. llvm-svn: 164829
* [analyzer] Create a temporary region for rvalue structs when accessing fieldsJordan Rose2012-09-283-13/+20
| | | | | | | | | | | | | | | | | Struct rvalues are represented in the analyzer by CompoundVals, LazyCompoundVals, or plain ConjuredSymbols -- none of which have associated regions. If the entire structure is going to persist, this is not a problem -- either the rvalue will be assigned to an existing region, or a MaterializeTemporaryExpr will be present to create a temporary region. However, if we just need a field from the struct, we need to create the temporary region ourselves. This is inspired by the way CodeGen handles calls to temporaries; support for that in the analyzer is coming next. Part of <rdar://problem/12137950> llvm-svn: 164828
* Avoid malloc thrashing in the uninitialized value analysis.Benjamin Kramer2012-09-281-11/+5
| | | | | | | - The size of the packed vector is often small, save mallocs using SmallBitVector. - Copying SmallBitVectors is also cheap, remove a level of indirection. llvm-svn: 164827
* PackedVector: Make the BitVector implementation configurable.Benjamin Kramer2012-09-281-13/+14
| | | | llvm-svn: 164826
* Fix a bug introduced in an earlier revision: actually return the StopReason, ↵Filipe Cabecinhas2012-09-281-1/+1
| | | | | | when we have a StopInfo object. llvm-svn: 164825
OpenPOWER on IntegriCloud