summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Fix symbol type for addresses of external functionsSam Clegg2017-06-133-4/+35
| | | | | | | | | | | | | | These symbols were previously not being marked as functions so were appearing as globals instead, and with the incorrect relocation type. Without this fix, objects that take address of external functions include them as global imports rather than function imports which then fails at link time. Differential Revision: https://reviews.llvm.org/D34068 llvm-svn: 305263
* Fix signed/unsigned comparison warning; NFCGeorge Burgess IV2017-06-131-1/+1
| | | | llvm-svn: 305262
* Adding one test that I forgot to include with the commit for ↵Wolfgang Pieb2017-06-132-0/+56
| | | | | | | | https://reviews.llvm.org/D32779. NFC llvm-svn: 305261
* Fix broken LLD test.Zachary Turner2017-06-131-0/+1
| | | | llvm-svn: 305260
* Revert "Revert "Fix alignment bug in COFF emission.""Eric Beckmann2017-06-131-46/+67
| | | | | | | | | | This revert was done so that my other patch to add test framework could land separately. Now the revert can be reverted and this patch can reland. This reverts commit 18b3c75b2b0d32601fb60a06b9672c33d6f0dff9. llvm-svn: 305259
* Update the test framework for llvm-cvtres to be more comprehensive.Eric Beckmann2017-06-1315-225/+748
| | | | | | | | | | Summary: Added test cases for multiple machine types, file merging, multiple languages, and more resource types. Also fixed new bugs these tests exposed. Subscribers: javed.absar, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34047 llvm-svn: 305258
* Revert "Fix alignment bug in COFF emission."Eric Beckmann2017-06-1315-815/+271
| | | | | | | | | I accidentally combined this patch with one for adding more tests, they should be separated. This reverts commit 3da218a523be78df32e637d3446ecf97c9ea0465. llvm-svn: 305257
* Fix alignment bug in COFF emission.Eric Beckmann2017-06-1315-271/+815
| | | | | | | | | | | | Summary: Fix alignment issue in D34020, by aligning all sections to 8 bytes. Reviewers: zturner Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34072 llvm-svn: 305256
* [IR] Remove override of operator new from PHINode.Craig Topper2017-06-131-5/+0
| | | | | | | | This just forwarded to the same signature in User. The version in User is protected so there's no danger of anyone outside of PHINode constructing with the wrong operator new. All PHINodes are created by a static Create function in PHINode. I believe at one point in history this called User::operator new(s, 0) so it was useful then. llvm-svn: 305255
* Update LangRef for PR27284.Adrian Prantl2017-06-121-14/+14
| | | | | | And reverse the ownership between DICompileUnit and DISubprogram. llvm-svn: 305254
* [WebAssembly] MC: Fix value of R_WEBASSEMBLY_TABLE_INDEX relocationsSam Clegg2017-06-122-14/+68
| | | | | | | | | | | | | Previously we were writing the value function index space value but for these types of relocations we want to be writing the table element index space value. Add a test case for these relocation types that fails without this change. Differential Revision: https://reviews.llvm.org/D33962 llvm-svn: 305253
* Use a fixed target triple to s to appease windows botsAdrian Prantl2017-06-121-1/+1
| | | | llvm-svn: 305252
* [IR] Stop deleting other signatures of User::operator new when we override ↵Craig Topper2017-06-127-65/+0
| | | | | | | | | | | | | | | | | | one signature in a class derived from User User has 3 signatures for operator new today. They take a single size, a size and a number of users, and a size, number of users, and descriptor size. Historically there used to only be one signature that took size and a number of uses. Long ago derived classes implemented their own versions that took just a size and would call the size and use count version. Then they left an unimplemented signature for the size and use count signature from User. As we moved to C++11 this unimplemented signature because = delete. Since then operator new has picked up two new signatures for operator new. But when the 3 argument version was added it was never added to the delete list in all of the derived classes where the 2 argument version is deleted. This makes things inconsistent. I believe once one version of operator new is created in a derived class name hiding will take care of making all of the base class signatures unavailable. So I don't think the deleted lines are needed at all. This patch removes all of the deletes in cases where there is an override or there is already a delete of another signature (that should trigger name hiding too). Differential Revision: https://reviews.llvm.org/D34120 llvm-svn: 305251
* Also check section address in test.Rafael Espindola2017-06-121-0/+3
| | | | | | | This shows an oddity of this output. While the section address is 0, the the symbol address is computed as if the section was allocatable. llvm-svn: 305250
* Fix line endings.Zachary Turner2017-06-122-16/+16
| | | | llvm-svn: 305249
* [pdb] Don't choke on unknown symbol types.Zachary Turner2017-06-123-6/+64
| | | | | | | | | When we get an unknown symbol type, we might as well at least dump it. Same goes for round-tripping through YAML, we can dump the record contents as raw bytes even if we don't know how to interpret it semantically. llvm-svn: 305248
* Inliner: Don't remove calls to readnone+nounwind (but not always_inline) ↵David Blaikie2017-06-122-9/+21
| | | | | | functions in the AlwaysInliner llvm-svn: 305245
* Fix an assertion failure when duplicate dbg.declares are present.Adrian Prantl2017-06-122-0/+51
| | | | | | | | | | This fixes PR33157. https://bugs.llvm.org//show_bug.cgi?id=33157 We might also think about disallowing duplicate dbg.declare intrinsics entirely, but this may complicate some passes needlessly. llvm-svn: 305244
* fix typos/formatting; NFCSanjay Patel2017-06-123-9/+6
| | | | llvm-svn: 305243
* Support: Don't set RLIMIT_AS on child processes when applying a memory limitDavid Blaikie2017-06-121-10/+0
| | | | | | | | | | | | | | | | | | | | | | It doesn't seem relevant to set an address space limit - this isn't important in any sense that I'm aware & it gets in the way of things that use a lot of address space, like llvm-symbolizer. This came up when I realized that bugpoint regression tests were much slower with -gsplit-dwarf than plain -g. Turned out that bugpoint subprocesses (opt, etc) were crashing and doing symbolization - but bugpoint runs those subprocesses with a 400MB memory limit. So with plain -g, mmaping the opt binary would exceed the memory limit, fail, and thus be really fast - no symbolization occurred. Whereas with -gsplit-dwarf, comically, having less to map in, it would succeed and then spend lots of time symbolizing. I've fixed at least the critical part of bugpoint's perf problem there by adding an option to allow bugpoint to disable symbolization. Thus improving the perfromance for -gsplit-dwarf and making the -g-esque speed available without this quirk/accidental benefit. llvm-svn: 305242
* [ADT] Add type-safe methods to FoldingSetImpl; NFC.George Burgess IV2017-06-121-28/+42
| | | | | | | Thankfully, this hasn't uncovered any new bugs. With this, issues like the one fixed in r305207 (hopefully) shouldn't happen again. llvm-svn: 305241
* Fix printing error.Zachary Turner2017-06-121-1/+1
| | | | llvm-svn: 305240
* Revert r301742 which made ExprConstant checking apply to all full-exprs.Nick Lewycky2017-06-1216-41/+65
| | | | | | This patch also exposed pre-existing bugs in clang, see PR32864 and PR33140#c3 . llvm-svn: 305239
* [ODRHash] Add diagnostic messages for typedef and type alias.Richard Trieu2017-06-123-5/+154
| | | | llvm-svn: 305238
* [llvm-pdbutil] Fix one more issue with no-id-stream PDBs.Zachary Turner2017-06-121-13/+20
| | | | | | | | | | This one occurred when we were dumping symbols, we have code that is prepared to dump many different types of symbols, including symbols which reference an ID stream. So when creating the dumper object, we assume that there is an ID stream. Fix this assumption. llvm-svn: 305237
* Slightly better fix for dealing with no-id-stream PDBs.Zachary Turner2017-06-124-8/+13
| | | | | | | | | The last fix required the user to manually add the required feature. This caused an LLD test to fail because I failed to update LLD. In practice we can hide this logic so it can just be transparently added when we write the PDB. llvm-svn: 305236
* [llvm-pdbdump] Don't fail on PDBs with no ID stream.Zachary Turner2017-06-126-4/+26
| | | | | | | | | Older PDBs don't have this. Its presence is detected by using the various "feature" flags that come at the end of the PDB Stream. Detect this, and don't try to dump the ID stream if the features tells us it's not present. llvm-svn: 305235
* [RS4GC] Drop invalid metadata after pointers are relocatedAnna Thomas2017-06-122-17/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After RS4GC, we should drop metadata that is no longer valid. These metadata is used by optimizations scheduled after RS4GC, and can cause a miscompile. One such metadata is invariant.load which is used by LICM sinking transform. After rewriting statepoints, the address of a load maybe relocated. With invariant.load metadata on a load instruction, LICM sinking assumes the loaded value (from a dererenceable address) to be invariant, and rematerializes the load operand and the load at the exit block. This transforms the IR to have an unrelocated use of the address after a statepoint, which is incorrect. Other metadata we conservatively remove are related to dereferenceability and noalias metadata. This patch drops such metadata on store and load instructions after rewriting statepoints. Reviewers: reames, sanjoy, apilipenko Reviewed by: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33756 llvm-svn: 305234
* Revert r303316, a change to ExprConstant to evaluate function arguments.Nick Lewycky2017-06-122-36/+5
| | | | | | The patch was itself correct but it uncovered other bugs which are going to be difficult to fix, per PR33140. llvm-svn: 305233
* AMDGPU/GlobalISel: Mark 32-bit G_ADD as legalTom Stellard2017-06-122-0/+24
| | | | | | | | | | | | Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D33992 llvm-svn: 305232
* [ADT] Reduce duplication between {Contextual,}FoldingSet; NFCGeorge Burgess IV2017-06-122-113/+94
| | | | | | | | | | | | | This is a precursor to another change (coming soon) that aims to make FoldingSet's API more type-safe. Without this, the type-safety change would just duplicate 4 more public methods between the already very similar classes. This renames FoldingSetImpl to FoldingSetBase so it's consistent with the FooBase -> FooImpl<T> -> Foo<T> convention we seem to have with other containers. llvm-svn: 305231
* AArch64: don't try to emit an add (shifted reg) for SP.Tim Northover2017-06-122-0/+296
| | | | | | | | | | The "Add/sub (shifted reg)" instructions use the 31 encoding for xzr and wzr rather than the SP, so we need to use different variants. Situations where this actually comes up are rare enough (see test-case) that I think falling back to DAG is fine. llvm-svn: 305230
* Fix a null pointer dereference in llvm-pdbutil pretty.Zachary Turner2017-06-122-14/+15
| | | | | | | | Static data members were causing a problem because I mistakenly assumed all members would affect a class's layout and so the Layout member would be non-null. llvm-svn: 305229
* SplitKit: Fix partially live subreg splittingMatthias Braun2017-06-121-2/+1
| | | | | | | | | Fix thinko/typo in subreg aware liverange splitting logic. I'm not sure how to write a proper testcase for this. The original problem only happens on an out-of-tree target. Forcing subreg enabled targets to spill and split in a predictable way is near impossible. llvm-svn: 305228
* IR: Replace the "Linker Options" module flag with "llvm.linker.options" ↵Peter Collingbourne2017-06-1232-168/+141
| | | | | | | | | | named metadata. The new metadata is easier to manipulate than module flags. Differential Revision: https://reviews.llvm.org/D31349 llvm-svn: 305227
* Remove unneeded conditionals - the code is already conditional on the same ↵David Blaikie2017-06-121-10/+8
| | | | | | condition llvm-svn: 305226
* Add EOL at EOF to appease source utils like unifdefTim Hammerquist2017-06-121-1/+1
| | | | | | <rdar://problem/32511256> llvm-svn: 305225
* Correct debug info bit offset calculation for big-endian targetsReid Kleckner2017-06-122-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The change "[CodeView] Implement support for bit fields in Clang" (r274201, https://reviews.llvm.org/rL274201) broke the calculation of bit offsets for the debug info describing bitfields on big-endian targets. Prior to commit r274201 the debug info for bitfields got their offsets from the ASTRecordLayout in CGDebugInfo::CollectRecordFields(), the current field offset was then passed on to CGDebugInfo::CollectRecordNormalField() and used directly in the DIDerivedType. Since commit r274201, the bit offset ending up in the DIDerivedType no longer comes directly from the ASTRecordLayout. Instead CGDebugInfo::CollectRecordNormalField() calls the new method CGDebugInfo::createBitFieldType(), which in turn calls CodeGenTypes::getCGRecordLayout().getBitFieldInfo() to fetch a CGBitFieldInfo describing the field. The 'Offset' member of CGBitFieldInfo is then used to calculate the bit offset of the DIDerivedType. Unfortunately the previous and current method of calculating the bit offset are only equivalent for little endian targets, as CGRecordLowering::setBitFieldInfo() reverses the bit offsets for big endian targets as the last thing it does. A simple reproducer for this error is the following module: struct fields { unsigned a : 4; unsigned b : 4; } flags = {0x0f, 0x1}; Compiled for Mips, with commit r274200 both the DIDerivedType bit offsets on the IR-level and the DWARF information on the ELF-level will have the expected values: the offsets of 'a' and 'b' are 0 and 4 respectively. With r274201 the offsets are switched to 4 and 0. By noting that the static initialization of 'flags' in both cases is the same, we can eliminate a change in record layout as the cause of the change in the debug info. Also compiling this example with gcc, produces the same record layout and debug info as commit r274200. In order to restore the previous function we extend CGDebugInfo::createBitFieldType() to compensate for the reversal done in CGRecordLowering::setBitFieldInfo(). Patch by Frej Drejhammar! Reviewers: cfe-commits, majnemer, rnk, aaboud, echristo, aprantl Reviewed By: rnk, aprantl Subscribers: aprantl, arichardson, frej Differential Revision: https://reviews.llvm.org/D32745 llvm-svn: 305224
* [llvm-ar] Make llvm-lib behave more like the MSVC archiverReid Kleckner2017-06-124-6/+37
| | | | | | | | | | | | | | | | | | | | | | Summary: Use the filepath used to open the archive member as the archive member name instead of the file basename. This path might be absolute or relative. This is important because the archive member name will show up in the PDB, and we want our PDBs to look as much like MSVC's as possible. This also helps avoid an issue in our PDB module descriptor writing code, which assumes that all module names are unique. Relative paths still aren't guaranteed to be unique, but they're much better than basenames, which definitely aren't unique. Reviewers: ruiu, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33575 llvm-svn: 305223
* Addressed Takumi's comment about redundancy.Galina Kistanova2017-06-121-32/+18
| | | | llvm-svn: 305222
* Recommit r305117: [libclang] Merge multiple availability clauses whenAlex Lorenz2017-06-122-46/+92
| | | | | | | | | | getting the platform's availability Patch by Ronald Wampler! Differential Revision: https://reviews.llvm.org/D33478 llvm-svn: 305221
* [DWARF] Added a blank line in llvm-dwarfdump to test commit access.Spyridoula Gravani2017-06-121-0/+1
| | | | llvm-svn: 305220
* Same expressions on both sides of the returnSylvestre Ledru2017-06-121-1/+1
| | | | | | | | | | | | | | | | | | | Summary: I guess we want PointerToMemberFunction & PointerToDataMember Fix coverity cid 1376038 Reviewers: zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34110 llvm-svn: 305219
* Allow the GNU gold-style nonstandard SHT_GROUP section.Rui Ueyama2017-06-125-11/+62
| | | | | | | | | | | | | | | | | | | | | The ELF standard defines that the SHT_GROUP section as follows: - its sh_link has the symbol index, and - the symbol name is used to uniquify section groups. Object files created by GNU gold does not seem to comply with the standard. They have this additional rule: - if the symbol has no name and a STT_SECTION symbol, a section name is used instead of a symbol name. If we don't do anything for this, the linker fails with a mysterious error message if input files are generated by gas. It is unfortunate but I think we need to support it. Differential Revision: https://reviews.llvm.org/D34064 llvm-svn: 305218
* [ubsan] Detect invalid unsigned pointer index expression (compiler-rt)Vedant Kumar2017-06-122-2/+21
| | | | | | | | Compiler-rt part of: https://reviews.llvm.org/D33910 Differential Revision: https://reviews.llvm.org/D33911 llvm-svn: 305217
* [ubsan] Detect invalid unsigned pointer index expression (clang)Vedant Kumar2017-06-124-52/+110
| | | | | | | | | | | | | | | | | | | | | | | | Adding an unsigned offset to a base pointer has undefined behavior if the result of the expression would precede the base. An example from @regehr: int foo(char *p, unsigned offset) { return p + offset >= p; // This may be optimized to '1'. } foo(p, -1); // UB. This patch extends the pointer overflow check in ubsan to detect invalid unsigned pointer index expressions. It changes the instrumentation to only permit non-negative offsets in pointer index expressions when all of the GEP indices are unsigned. Testing: check-llvm, check-clang run on a stage2, ubsan-instrumented build. Differential Revision: https://reviews.llvm.org/D33910 llvm-svn: 305216
* Address David Blaikie comment by replacing grep with FileCheck.Yaron Keren2017-06-121-1/+2
| | | | llvm-svn: 305215
* [PowerPC] Match vec_revb builtins to P9 instructions.Tony Jiang2017-06-125-7/+159
| | | | | | | | | | | | Power9 has instructions that will reverse the bytes within an element for all sizes (half-word, word, double-word and quad-word). These can be used for the vec_revb builtins in altivec.h. However, we implement these to match vector shuffle nodes as that will cover both the builtins and vector shuffles that occur in the SDAG through other means. Differential Revision: https://reviews.llvm.org/D33690 llvm-svn: 305214
* Add regression test for r305179.Yaron Keren2017-06-121-0/+3
| | | | llvm-svn: 305213
* Fix weak symbols on arm and aarch64.Rafael Espindola2017-06-125-29/+39
| | | | | | | | | | | | | | | | | | | | Given .weak target .global _start _start: b target The intention is that the branch goes to the instruction after the branch, effectively turning it on a nop. The branch adds the runtime PC, but we were adding it statically too. I noticed the oddity by inspection, but llvm-objdump seems to agree, since it now prints things like: b #-4 <_start+0x4> llvm-svn: 305212
OpenPOWER on IntegriCloud