summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Don't crash on implicit statements inside initializers.Jordan Rose2012-07-264-9/+64
| | | | | | | | | | | | | | | | | | | Our BugReporter knows how to deal with implicit statements: it looks in the ParentMap until it finds a parent with a valid location. However, since initializers are not in the body of a constructor, their sub-expressions are not in the ParentMap. That was easy enough to fix in AnalysisDeclContext. ...and then even once THAT was fixed, there's still an extra funny case of Objective-C object pointer fields under ARC, which are initialized with a top-level ImplicitValueInitExpr. To catch these cases, PathDiagnosticLocation will now fall back to the start of the current function if it can't find any other valid SourceLocations. This isn't great, but it's miles better than a crash. (All of this is only relevant when constructors and destructors are being inlined, i.e. under -cfg-add-initializers and -cfg-add-implicit-dtors.) llvm-svn: 160810
* [analyzer] Don't crash on array constructors and destructors.Jordan Rose2012-07-264-17/+82
| | | | | | | | This workaround is fairly lame: we simulate the first element's constructor and destructor and rely on the region invalidation to "initialize" the rest of the elements. llvm-svn: 160809
* [analyzer] Handle C++ member initializers and destructors.Jordan Rose2012-07-266-28/+127
| | | | | | | This uses CFG to tell if a constructor call is for a member, and uses the member's region appropriately. llvm-svn: 160808
* [analyzer] Use the CFG to see if a constructor is for a local variable.Jordan Rose2012-07-261-34/+22
| | | | | | | | | Previously we were using ParentMap and crawling through the parent DeclStmt. This should be at least slightly cheaper (and is also more flexible). No (intended) functionality change. llvm-svn: 160807
* [analyzer] Handle base class initializers and destructors.Jordan Rose2012-07-265-92/+149
| | | | | | | | | | | | | Most of the logic here is fairly simple; the interesting thing is that we now distinguish complete constructors from base or delegate constructors. We also make sure to cast to the base class before evaluating a constructor or destructor, since non-virtual base classes may behave differently. This includes some refactoring of VisitCXXConstructExpr and VisitCXXDestructor in order to keep ExprEngine.cpp as clean as possible (leaving the details for ExprEngineCXX.cpp). llvm-svn: 160806
* [analyzer] Variables with destructors are live until the destructor is run.Jordan Rose2012-07-261-0/+6
| | | | | | | Test case in the next commit, which enables destructors under certain circumstances. llvm-svn: 160805
* [analyzer] Show paths for destructor calls.Jordan Rose2012-07-265-64/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies BugReporter and friends to handle CallEnter and CallExitEnd program points that came from implicit call CFG nodes (read: destructors). This required some extra handling for nested implicit calls. For example, the added multiple-inheritance test case has a call graph that looks like this: testMultipleInheritance3 ~MultipleInheritance ~SmartPointer ~Subclass ~SmartPointer ***bug here*** In this case we correctly notice that we started in an inlined function when we reach the CallEnter program point for the second ~SmartPointer. However, when we reach the next CallEnter (for ~Subclass), we were accidentally re-using the inner ~SmartPointer call in the diagnostics. Rather than guess if we saw the corresponding CallExitEnd based on the contents of the active path, we now just ask the PathDiagnostic if there's any known stack before popping off the top path. (A similar issue could have occured without multiple inheritance, but there wasn't a test case for it.) llvm-svn: 160804
* [analyzer] Inline ctors + dtors when the CFG is built for them.Jordan Rose2012-07-262-5/+33
| | | | | | | At the very least this means initializer nodes for constructors and automatic object destructors are present in the CFG. llvm-svn: 160803
* [analyzer] PostImplicitCall can also occur between CFGElements.Jordan Rose2012-07-261-1/+3
| | | | | | | This avoids an assertion crash when we invalidate on a destructor call instead of inlining it. llvm-svn: 160802
* Add a const version of Expr::IgnoreImplicit. No functionality change.Jordan Rose2012-07-261-0/+4
| | | | llvm-svn: 160801
* Un-break standalone invocations of CmpRuns.py.Jordan Rose2012-07-261-1/+1
| | | | | | Fallout from CmpRuns.py API changes in r160314. llvm-svn: 160800
* Patch by Andrew C. Morrow: shims to work around macroized getc and putc on ↵Howard Hinnant2012-07-261-0/+12
| | | | | | | | | linux. On my eglibc 2.13 based Debian system 'getc' is a macro defined in /usr/include/stdio.h. This decision to make it a macro doesn't seem to be guarded by any feature test macro as far as I can see. llvm-svn: 160799
* Use an otherwise unused variable.Jakob Stoklund Olesen2012-07-261-1/+1
| | | | llvm-svn: 160798
* tsan: make the runtime library name tsan-neutral for Go upstreamDmitry Vyukov2012-07-261-1/+1
| | | | llvm-svn: 160797
* Start scaffolding for a MachineTraceMetrics analysis pass.Jakob Stoklund Olesen2012-07-266-1/+731
| | | | | | | | | | | | | | | | | | | | | | | | This is still a work in progress. Out-of-order CPUs usually execute instructions from multiple basic blocks simultaneously, so it is necessary to look at longer traces when estimating the performance effects of code transformations. The MachineTraceMetrics analysis will pick a typical trace through a given basic block and provide performance metrics for the trace. Metrics will include: - Instruction count through the trace. - Issue count per functional unit. - Critical path length, and per-instruction 'slack'. These metrics can be used to determine the performance limiting factor when executing the trace, and how it will be affected by a code transformation. Initially, this will be used by the early if-conversion pass. llvm-svn: 160796
* Relax the test for "is the frame I am going to step back out to the one I ↵Jim Ingham2012-07-262-1/+31
| | | | | | | | | | | | started from" in ThreadPlanStepOverRange so you don't artificially reject stepping out of a function you stepped into when stepping through an inlined range. Also fill in the target in the symbol context we make up for the inlined stepping range in ThreadPlanStepOut. <rdar://problem/11765912> llvm-svn: 160794
* Add a floor intrinsic.Dan Gohman2012-07-263-0/+41
| | | | llvm-svn: 160791
* Patch by Andrew C. Morrow: Conditionally include cxxabi.h in new.cpp and ↵Howard Hinnant2012-07-262-1/+17
| | | | | | | | | | | | typeinfo.cpp. Both new.cpp and typeinfo.cpp have code that is conditionally compiled based on the LIBCXXRT and _LIBCPPABI_VERSION defines, but those files do not currently include <cxxabi.h> in the non __APPLE__ case. The attached patch updates those files so that for non __APPLE__ builds <cxxabi.h> is included if available or if LIBCXXRT is set. I'm modeling this on the recent updates to exception.cpp. llvm-svn: 160790
* objective-c parsing. Don't crash when selector nameFariborz Jahanian2012-07-262-5/+57
| | | | | | is missing in method prototype. // rdar://11939584 llvm-svn: 160789
* Put back dump() without a default argument, "because debuggers don't usually ↵Alexander Kornienko2012-07-261-2/+6
| | | | | | respect default arguments". llvm-svn: 160788
* do null checks for a few more Emit*() functions.Nuno Lopes2012-07-261-17/+15
| | | | | | Thanks Eli for noticing. llvm-svn: 160787
* <algorithm> no longer needs to include <cstdlib>, but can get away with just ↵Howard Hinnant2012-07-263-1/+3
| | | | | | <cstddef>. This was brought to my attention by Salvatore Benedetto in his port to a bare-metal coretex-m3. This exposed two test bugs where an explicit #include <cstdlib> was needed. llvm-svn: 160786
* locale::id really needs to be constructed at compile time.Howard Hinnant2012-07-261-1/+1
| | | | llvm-svn: 160785
* Added -ast-dump-filter option to clang -cc1.Alexander Kornienko2012-07-269-31/+79
| | | | llvm-svn: 160784
* Remove an outdated comment; add one test to compare function pointer and ↵Timur Iskhodzhanov2012-07-262-5/+7
| | | | | | block mangling llvm-svn: 160783
* Add more tests for PR13207 (Mangling of template back references with ↵Timur Iskhodzhanov2012-07-261-0/+25
| | | | | | -cxx-abi microsoft) now that PR13389 is fixed (mangling of return types) llvm-svn: 160782
* Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)Timur Iskhodzhanov2012-07-262-2/+182
| | | | llvm-svn: 160780
* Stop reassociate from looking through expressions of arbitrary complexity. ThisDuncan Sands2012-07-263-0/+39
| | | | | | is a temporary measure until my fix for PR13021 is ready. llvm-svn: 160778
* Take people straight to the contents of the file.Duncan Sands2012-07-261-1/+1
| | | | llvm-svn: 160777
* Add the list of code owners to the top level of the LLVM source tree toDuncan Sands2012-07-262-27/+55
| | | | | | | | | hopefully make it more visible. Adjust the web-docs to have a link to this file rather than the list itself. I described code owners as also being gatekeepers for their part of the code, which I think is true but isn't in the code owner explanation on the web page. llvm-svn: 160776
* Make l/q suffixes on AVX forms of scalar convert instructions consistent ↵Craig Topper2012-07-266-50/+52
| | | | | | with their non-AVX forms. llvm-svn: 160775
* Fix call setup for PIC.Akira Hatanaka2012-07-266-57/+72
| | | | | | Patch by Reed Kotler. llvm-svn: 160774
* libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with aRichard Smith2012-07-263-15/+15
| | | | | | platform-provided macro on some systems) to _LIBCPP_NORETURN. llvm-svn: 160773
* Removed standalone clang-ast-dump tool.Alexander Kornienko2012-07-267-197/+3
| | | | llvm-svn: 160772
* Updating Xcode project version numbers for lldb-163 and debugserver-190Sean Callanan2012-07-265-28/+28
| | | | llvm-svn: 160770
* Integrated a fix to LLVM's disassembler thatSean Callanan2012-07-261-1/+1
| | | | | | | | | corrected the offsets for x86_64 conditional branch instructions. <rdar://problem/11502148> llvm-svn: 160769
* [analyzer] Inline ObjC class methods.Anna Zaks2012-07-266-66/+214
| | | | | | | | | | - Some cleanup(the TODOs) will be done after ObjC method inlining is complete. - Simplified CallEvent::getDefinition not to require ISDynamicDispatch parameter. - Also addressed Jordan's comments from r160530. llvm-svn: 160768
* Add static analyzer check for calling a C++ instance method with a ↵Ted Kremenek2012-07-262-2/+46
| | | | | | null/uninitialized pointer. llvm-svn: 160767
* Disable the warning for missing prototypes for OpenCL kernels. Includes ↵Tanya Lattner2012-07-262-0/+10
| | | | | | testcase. llvm-svn: 160766
* Remove the ability to stash arbitrary pointers into UndefinedVal (no longer ↵Ted Kremenek2012-07-252-10/+0
| | | | | | needed). llvm-svn: 160764
* Fix two typos in the docSylvestre Ledru2012-07-252-2/+2
| | | | llvm-svn: 160763
* Fix two typos in the docSylvestre Ledru2012-07-252-2/+2
| | | | llvm-svn: 160762
* Remove ExprEngine::MarkBranch(), as it is no longer needed.Ted Kremenek2012-07-252-72/+4
| | | | llvm-svn: 160761
* Update ExprEngine's handling of ternary operators to find the ternary expressionTed Kremenek2012-07-252-9/+26
| | | | | | | | value by scanning the path, rather than assuming we have visited the '?:' operator as a terminator (which sets a value indicating which expression to grab the final ternary expression value from). llvm-svn: 160760
* objective-c modern translator. Provide declaration ofFariborz Jahanian2012-07-251-6/+3
| | | | | | | | "memset' lazily when is needed in translation of struct-valued methods which require checkinf of nil receivers outside their bodies. // rdar://11847319 llvm-svn: 160759
* Differentially encode all MC register lists.Jakob Stoklund Olesen2012-07-252-78/+50
| | | | | | | This simplifies MCRegisterInfo and shrinks the target descriptions a bit more. llvm-svn: 160758
* It's not safe to blindly remove invoke instructions. This happens when weNick Lewycky2012-07-251-1/+2
| | | | | | | encounter an invoke of an allocation function. This should fix the dragonegg bootstrap. Testcase to follow, later. llvm-svn: 160757
* Add a call to "sync" a thread state before checkpointing registers in ↵Jim Ingham2012-07-2512-4/+130
| | | | | | | | | | | preparation for calling functions. This is necessary on Mac OS X, since bad things can happen if you set the registers of a thread that's sitting in a kernel trap. <rdar://problem/11145013> llvm-svn: 160756
* Update testing case for Atom when disabling rematerialization inManman Ren2012-07-251-1/+97
| | | | | | | | | TwoAddressInstructionPass. The generated code for Atom has a different code sequence. This is realted to commit r160749. llvm-svn: 160755
* Remove experimental invalid iterators checker from the codebase until we ↵Ted Kremenek2012-07-254-718/+0
| | | | | | | | | have the time to fix all the issues. Currently the code is essentially unmaintained and buggy, and needs major revision (with coupled enhancements to the analyzer core). llvm-svn: 160754
OpenPOWER on IntegriCloud