summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix ref counting of Python objects.Zachary Turner2015-10-135-813/+753
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PythonObjects were being incorrectly ref-counted. This problem was pervasive throughout the codebase, leading to an unknown number of memory leaks and potentially use-after-free. The issue stems from the fact that Python native methods can either return "borrowed" references or "owned" references. For the former category, you *must* incref it prior to decrefing it. And for the latter category, you should not incref it before decrefing it. This is mostly an issue when a Python C API method returns a `PyObject` to you, but it can also happen with a method accepts a `PyObject`. Notably, this happens in `PyList_SetItem`, which is documented to "steal" the reference that you give it. So if you pass something to `PyList_SetItem`, you cannot hold onto it unless you incref it first. But since this is one of only two exceptions in the entire API, it's confusing and difficult to remember. Our `PythonObject` class was indiscriminantely increfing every object it received, which means that if you passed it an owned reference, you now have a dangling reference since owned references should not be increfed. We were doing this in quite a few places. There was also a fair amount of manual increfing and decrefing prevalent throughout the codebase, which is easy to get wrong. This patch solves the problem by making any construction of a `PythonObject` from a `PyObject` take a flag which indicates whether it is an owned reference or a borrowed reference. There is no way to construct a `PythonObject` without this flag, and it does not offer a default value, forcing the user to make an explicit decision every time. All manual uses of `PyObject` have been cleaned up throughout the codebase and replaced with `PythonObject` in order to make RAII the predominant pattern when dealing with native Python objects. Differential Revision: http://reviews.llvm.org/D13617 Reviewed By: Greg Clayton llvm-svn: 250195
* Updating the documentation for the ↵Aaron Ballman2015-10-131-2/+13
| | | | | | | | readability-inconsistent-declaration-parameter-name checker. Patch by Piotr Dziwinski. llvm-svn: 250194
* ExecutionEngine: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-131-5/+4
| | | | llvm-svn: 250193
* OrcJIT: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-131-1/+1
| | | | llvm-svn: 250192
* ELF2: Avoid using "finalize" as a function name.Rui Ueyama2015-10-133-9/+10
| | | | | | | | | "finalize" does not give a hint about what that function is actually going to do. This patch make it more specific by renaming scanShlibUndefined. Also add a comment that we basically ignore undefined symbols in DSOs except this function. llvm-svn: 250191
* [ELF2] Ensure strict weak ordering in section sorting (v2)Hal Finkel2015-10-131-2/+3
| | | | | | | | | | | | The fix in r250109 to ensure a strict weak ordering in the section sorting was a bit overzealous. We only use the NOBITS comparison if either A or B is a NOBITS section. Otherwise, we fall through to the target-specific ranking function. Failure to do this causes the sorting to fail in cases where, for example, a .dynamic section happens to end up in between .got and .toc, etc. in the initial ordering (.dynamic has a type SHT_DYNAMIC, compared to SHT_PROGBITS or SHT_NOBITS). llvm-svn: 250190
* Xfail a watchpoint test on Windows, until Windows implements watchpoints.Adrian McCarthy2015-10-131-0/+1
| | | | llvm-svn: 250189
* Fix TestTargetAPI.py test for users who use Swig 3.0.5 or greater.Adrian McCarthy2015-10-132-0/+5
| | | | | DifferentialRevision: http://reviews.llvm.org/D13679 llvm-svn: 250188
* IPO: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-1313-99/+97
| | | | llvm-svn: 250187
* Instrumentation: Remove ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-139-57/+59
| | | | llvm-svn: 250186
* Interpreter: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-131-2/+2
| | | | llvm-svn: 250185
* The issue with the malformed-machos 00000031.a test is that it needed ↵Kevin Enderby2015-10-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ‘-arch x86_64’ flag as it was a Mach-O universal file. The default as to which architecture slice that is dumped without an -arch flag depends on the host architecture and the contents of the universal file. The malformed archive 00000031.a file has both an x86_64 and i386 slice. So for for x86_64 hosts only that slice is dumped, for non-x86_64 hosts, which is many of the bots both slices are dumped. The test is intended to only check that the malformation of the x86_64 which has a non-decimal characters in the size field of the archive header so it no longer crashes. The problem turned out that the i388 slice of the malformed archive had a different malformation which was causing the non-x86_64 bots to get this error: llvm-objdump -macho -disassemble -arch i386 00000031.a Archive : .00000031.a 00000031.a(c_start.o): LLVM ERROR: Symbol name entry points before beginning or past end of file. and causing the test as it was written to fail. So by adding ‘-arch x86_64’ it should correct the test and the malformation on the i388 slice will not be dumped. Also the removal of the malformed-machos mem-crup-0261.macho was not causing the issue so that is put back in. Sorry for the churn on these tests, Kev llvm-svn: 250184
* InstCombine: Remove ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-138-37/+38
| | | | | | | Stop relying on implicit conversions of ilist iterators in LLVMInstCombine. No functionality change intended. llvm-svn: 250183
* Revert r250169: "This patch implements basic variant of lazy loading for ↵Rui Ueyama2015-10-1310-337/+92
| | | | | | | | x86_x64 and for X86 targets." With this patch LLD is not able to self-host on x86-64 Linux. llvm-svn: 250182
* BitcodeReader: Remove ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-131-6/+5
| | | | | | | Get LLVMBitReader building without relying on `ilist_iterator` implicit conversions. llvm-svn: 250181
* Fix cast in arm watchpoint handling codeTamas Berghammer2015-10-131-1/+1
| | | | | | | We had an incorrect sign extension when castion from a pointer to an lldb::addr_t what broke the watchpoint hit detection on arm. llvm-svn: 250180
* [WinEH] Iterate state changes instead of invokesJoseph Tremoulet2015-10-132-151/+196
| | | | | | | | | | | | | | | | | | | | | | Summary: Add an iterator that can walk across blocks and which visits the state transitions rather than state ranges, with explicit transitions to -1 indicating the presence of top-level calls that may throw and cause the current function to unwind to caller. This will simplify code that needs to identify nested try regions. Refactor SEH and C++EH table generation to use the new InvokeStateChangeIterator, and remove the InvokeLabelIterator they were using. Reviewers: majnemer, andrew.w.kaylor, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13623 llvm-svn: 250179
* Remove extra semicolons for -Wpedantic.Rui Ueyama2015-10-131-4/+4
| | | | llvm-svn: 250178
* Fix a couple of comments; NFCXinliang David Li2015-10-131-6/+6
| | | | llvm-svn: 250177
* ELF2: Fix BSD's __progname symbol issue.Rui Ueyama2015-10-136-4/+51
| | | | | | | | | | | | | BSD's DSO files have undefined symbol "__progname" which is defined in crt1.o. On that system, both user programs and system shared libraries depend on each other. In general, we need to put symbols defined by user programs which are referenced by shared libraries to user program's .dynsym. http://reviews.llvm.org/D13637 llvm-svn: 250176
* Symbols::LocateExecutableSymbolFile() shouldn't try to look for files in ↵Vadim Macagon2015-10-131-0/+2
| | | | | | | | | | | | | | | | /usr/lib/debug on Windows Summary: /usr/lib/debug doesn't exist on Windows so there's no point even attempting to look for symbol files in there. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13636 llvm-svn: 250175
* function names should start with a lower case letter; NFCSanjay Patel2015-10-134-116/+116
| | | | llvm-svn: 250174
* Always pass a -dwarf-version argument to integrated as.Douglas Katzman2015-10-133-3/+19
| | | | | | | | This removes the default of 3 hidden in the assembler previously. Fixes breakage caused by r249655, reported by vsukharev. llvm-svn: 250173
* ELF2: Rename ElfKind -> EKind.Rui Ueyama2015-10-134-7/+6
| | | | | | ELFKind as a type name and ElfKind is a variable name was too subtle. llvm-svn: 250172
* ELF2: Fix typos in comment.Rui Ueyama2015-10-131-3/+3
| | | | llvm-svn: 250171
* Remove trailing whitespaces.Rui Ueyama2015-10-135-7/+7
| | | | llvm-svn: 250170
* This patch implements basic variant of lazy loading for x86_x64 and for X86 ↵George Rimar2015-10-1310-93/+338
| | | | | | | | | | | | | | | | | | | targets. What was done: 1) .got.plt section is created for functions that requires PLT. .got.plt has 3 predefined empty entries now that are required for dynamic linker. Also other new items created are configured to have correct jump to PLT[N]. 2) PLT section now has PLT[0] entry, also others ones are configured to support PLT->GOT(.got.plt) calls. 3) Implemented .rel[a].plt sections (based on patch http://reviews.llvm.org/D13569). 4) Fixed plt relocations types (based on patch http://reviews.llvm.org/D13589). NOTES: The .plt.got zero entry is still empty now. According to ELF specification it should hold the address of the dynamic structure, referenced with the symbol _DYNAMIC. The _DYNAMIC entry points to the .dynamic section which contains information used by the ELF interpreter to setup the binary. Differential Revision: http://reviews.llvm.org/D13651 llvm-svn: 250169
* ELF2: Move createTarget to Target.cpp.Rui Ueyama2015-10-133-18/+19
| | | | | | | | Now all Target<Arch> classes are used only in Target.cpp. We can put them in an anonymous namespace. In order to avoid merge conflict with other people's patches, I'll do that later. llvm-svn: 250168
* ELF2: Remove dead code.Rui Ueyama2015-10-134-33/+2
| | | | | | This code is completely a stub. We can resurrect when we start working on ARM. llvm-svn: 250167
* Appeasing build bots by linking in the proper libraries.Aaron Ballman2015-10-131-0/+1
| | | | llvm-svn: 250166
* Expose the clang-tidy misc-assign-operator-signature checker as ↵Aaron Ballman2015-10-133-6/+15
| | | | | | cppcoreguidelines-c-copy-assignment-signature. llvm-svn: 250165
* [Driver] Use the parent_path of the clang executable as the default InstalledDirBenjamin Kramer2015-10-132-2/+42
| | | | | | | | This is what most people want anyways. Clang -cc1's main() will override this but for other tools this is the most sensible default and avoids some work. llvm-svn: 250164
* Removed undefined and unused member. NFC.George Rimar2015-10-131-1/+0
| | | | llvm-svn: 250163
* don't repeat function/class/variable names in comments; NFCSanjay Patel2015-10-131-60/+46
| | | | llvm-svn: 250162
* Remove unnecessary include.Rafael Espindola2015-10-131-1/+0
| | | | llvm-svn: 250161
* [InstCombine][SSE4A] Remove broken INSERTQI range combining optimizationSimon Pilgrim2015-10-132-130/+4
| | | | | | | | As discussed in D13348 - the INSERTQI range combining code is wrong in that it confuses the insertion bit index with an extraction bit index. The remaining legal combines are very unlikely (especially once we've converted to shuffles in D13348) so I'm removing the optimization. llvm-svn: 250160
* Simplify by using Out<ELFT>::Opd.Rafael Espindola2015-10-131-6/+5
| | | | | | Also avoid extra dependencies on the section name. llvm-svn: 250159
* [X86] Add XSAVE intrinsic familyAmjad Aboud2015-10-1312-7/+485
| | | | | | | | | | | | Add intrinsics for the XSAVE instructions (XSAVE/XSAVE64/XRSTOR/XRSTOR64) XSAVEOPT instructions (XSAVEOPT/XSAVEOPT64) XSAVEC instructions (XSAVEC/XSAVEC64) XSAVES instructions (XSAVES/XSAVES64/XRSTORS/XRSTORS64) Differential Revision: http://reviews.llvm.org/D13014 llvm-svn: 250158
* [GlobalsAA] Turn GlobalsAA on again by defaultJames Molloy2015-10-131-1/+1
| | | | | | | | Now that all the known faults with GlobalsAA have been fixed, flip the big switch on -enable-non-lto-gmr again. Feel free to pester me with any more bugs found, and don't hesitate to flip the switch back off. llvm-svn: 250157
* [GlobalsAA] Don't assume anything about functions that may be overriddenJames Molloy2015-10-132-2/+26
| | | | | | | | Weak linkage and friends allow a symbol to be overriden outside the code generator's model, so GlobalsAA shouldn't assume that anything it can compute about such a symbol is valid. llvm-svn: 250156
* Remove unused diagnostic. NFC.Benjamin Kramer2015-10-131-2/+0
| | | | llvm-svn: 250155
* Test commitChristof Douma2015-10-131-1/+0
| | | | llvm-svn: 250154
* Remove unnecessary argument in ipo iteratorMichael Liao2015-10-131-4/+4
| | | | | | - Otherwise, it won't be compiled if that template is instantiated. llvm-svn: 250153
* [IndVars] NFC Cleanup.Sanjoy Das2015-10-131-66/+62
| | | | | | | | - Rename methods according to the LLVM Coding Style - Merge adjacent anonymous namespace block - Use `auto` in two places llvm-svn: 250152
* Fix line-ending issue. NFC.Michael Kuperstein2015-10-131-2/+2
| | | | llvm-svn: 250151
* [CMake] LLVM_PROFDATA_FILE only works if you're using clang, so we should ↵Chris Bieneman2015-10-132-1/+9
| | | | | | | | | | error out if it is specified when not using clang. Also updated the CMake docs. Based on post-commit review of r250108 from Sean Silvas. llvm-svn: 250150
* [X86] LLVM now prints XOP immediates as unsigned after r250147. Fix expected ↵Craig Topper2015-10-131-1/+1
| | | | | | check string accordingly. llvm-svn: 250149
* [X86] Mark the AAD and AAM aliases as not valid in 64-bit mode.Craig Topper2015-10-131-2/+2
| | | | llvm-svn: 250148
* [X86] Change all the i8imm operands in XOP instructions to u8imm so the ↵Craig Topper2015-10-131-10/+10
| | | | | | parser will check the size. llvm-svn: 250147
* Preliminary NetBSD supportBruce Mitchener2015-10-1313-1/+1460
| | | | | | | | | | | | | | | | | | | Summary: This adds platform code without the cmake/gmake glue to the existing infrastructure. The missing and incompatibility ptrace(2) bits (existing in FreeBSD) are under active research and development and will be submitted once verified to work. This code was tested to build and run on NetBSD-current/amd64. Proper build scripts will be integrated separately as a new commit. Reviewers: joerg Subscribers: tfiala, brucem, labath, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D13334 llvm-svn: 250146
OpenPOWER on IntegriCloud