summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix some cases were ArrayRefs were being passed by reference. Also remove ↵Craig Topper2014-08-275-8/+8
| | | | | | 'const' from some other ArrayRef uses since its implicitly const already. llvm-svn: 216524
* InstCombine: Optimize GEP's involving ptrtoint betterDavid Majnemer2014-08-272-11/+74
| | | | | | | | | | | | | | We supported transforming: (gep i8* X, -(ptrtoint Y)) to: (inttoptr (sub (ptrtoint X), (ptrtoint Y))) However, this only fired if 'X' had type i8*. Generalize this to support various types of different sizes. This results in much better CodeGen, especially for pointers to packed structs. llvm-svn: 216523
* Driver: Restore -fkeep-inline-functions as an ignored flagJustin Bogner2014-08-272-1/+3
| | | | | | | | | | Several options were moved to the clang_ignored_gcc_optimization group in r213365, but -fkeep-inline-functions was accidentally dropped. This restores the flag. Patch by Steven Wu. Thanks! llvm-svn: 216522
* Remove type unit skeletons. GDB no longer needs them & this saves a heap of ↵David Blaikie2014-08-272-40/+7
| | | | | | space. llvm-svn: 216521
* Fix representation of __attribute__((nonnull)) to support correctly modelingRichard Smith2014-08-2711-66/+129
| | | | | | | | | | | | | | | the no-arguments case. Don't expand this to an __attribute__((nonnull(A, B, C))) attribute, since that does the wrong thing for function templates and varargs functions. In passing, fix a grammar error in the diagnostic, a crash if __attribute__((nonnull(N))) is applied to a varargs function, a bug where the same null argument could be diagnosed multiple times if there were multiple nonnull attributes referring to it, and a bug where nonnull attributes would not be accumulated correctly across redeclarations. llvm-svn: 216520
* Change a few methods to static methods. No functionality change.Richard Trieu2014-08-271-12/+15
| | | | llvm-svn: 216519
* PR20760: Don't assert (and produce better diagnostics) if a default initializerRichard Smith2014-08-273-20/+41
| | | | | | contains an unmatched closing bracket token. llvm-svn: 216518
* Refactor the diagnostic DeclContext printing. No functionality change.Richard Trieu2014-08-271-10/+6
| | | | llvm-svn: 216517
* ClangCodeGenTests: Prune redundant libdeps.NAKAMURA Takumi2014-08-272-7/+2
| | | | llvm-svn: 216516
* [CMake] ClangCodeGenTests: Add Core. It's referenced by the test.NAKAMURA Takumi2014-08-271-0/+1
| | | | llvm-svn: 216515
* ClangCodeGenTests: Reorder libdeps.NAKAMURA Takumi2014-08-272-4/+4
| | | | llvm-svn: 216514
* Add __NSCFDictionary to the list of NSDictionary-like types for which we ↵Enrico Granata2014-08-271-0/+1
| | | | | | know to generate synthetic children llvm-svn: 216513
* [PECOFF] Fix AMD64_ADDR64 relocation.Rui Ueyama2014-08-273-2/+6
| | | | | | | | IMAGE_REL_AMD64_ADDR64 relocation should set 64-bit *VA* (virtual address) instead of *RVA* (relative virtual address), so we have to add the iamge base to the target's RVA. llvm-svn: 216512
* [FastISel][AArch64] Fix address simplification.Juergen Ributzka2014-08-272-8/+130
| | | | | | | | | | | | When a shift with extension or an add with shift and extension cannot be folded into the memory operation, then the address calculation has to be materialized separately. While doing so the code forgot to consider a possible sign-/zero- extension. This fix folds now also the sign-/zero-extension into the add or shift instruction which is used to materialize the address. This fixes rdar://problem/18141718. llvm-svn: 216511
* [FastISel][AArch64] Fold Sign-/Zero-Extend into the shift immediate instruction.Juergen Ributzka2014-08-272-55/+419
| | | | llvm-svn: 216510
* ClangCodeGenTests: Quick fix to USEDLIBS. clangCodeGen requires, at least, ↵NAKAMURA Takumi2014-08-271-3/+3
| | | | | | AST, Basic, Frontend, and Lex. llvm-svn: 216509
* Revert r216497: "[libcxx] Fix ctype_byname<wchar_t>::do_is() mask checking."Jonathan Roelofs2014-08-271-30/+30
| | | | | | | | | | | | | | | | After discussing implementing more tests for this with @danalbert & @mclow, I realized this change is not correct. The C++ standard requires do_is() to behave as if it were a loop that checked is(). Furthermore, it requires is() to check "The first form returns the result of the expression (M & m) != 0; i.e., true if the character has the characteristics specified"... which the reverted patch definitely does not conform to. Even further, furthermore, this requires that ctype's mask be an actual bitmask, unlike what android and newlib provide for _ctype_. Fixing the original bug that instigated this patch remains TBD. llvm-svn: 216508
* Re-apply r216491 (Win64 ABI shouldn't extend integer type arguments.)Julien Lerouge2014-08-273-2/+23
| | | | | | | | | This time though, preserve the extension for bool types since that's compatible with what MSVC expects. See http://reviews.llvm.org/D4380 llvm-svn: 216507
* Fix missing component.Julien Lerouge2014-08-271-1/+2
| | | | llvm-svn: 216506
* Fix a couple of debug info test cases to match the metadata schema change in ↵David Blaikie2014-08-272-2/+2
| | | | | | | | r216239 Found these while testing something else. llvm-svn: 216505
* Clean up after the multithreaded test case finishes.Jason Molenda2014-08-261-0/+3
| | | | | | | Patch by Sean Callanan. <rdar://problem/18140875> llvm-svn: 216504
* [modules] Don't assert when merging virtual functions that override otherRichard Smith2014-08-264-5/+30
| | | | | | | functions. Also don't needlessly pull in non-canonical declarations of the overridden virtual functions. llvm-svn: 216503
* There seems to be no sane reason for a test case to enable logging every ↵Enrico Granata2014-08-261-2/+0
| | | | | | time it runs.. probably leftover from when I was debugging it llvm-svn: 216502
* clang-format: Don't butcher __asm blocks.Daniel Jasper2014-08-262-0/+30
| | | | | | | | Instead completely cop out of formatting them for now. This fixes llvm.org/PR20618. llvm-svn: 216501
* Attempt to address cmake buildbot failureKeno Fischer2014-08-261-2/+3
| | | | | | | | | CMake gets confused by the fact that both LLVM and Clang now have a CodeGen unittest. Rename the target to avoid that. The new test was also missing ProfileData (thanks to Julien Lerouge for pointing that out) llvm-svn: 216499
* Don't have ProcessMachCore::CanDebug use the Target's arch whenJason Molenda2014-08-261-1/+5
| | | | | | | | | | creating the ModuleSpec to load the core file - we won't have a fat core file and we can end up with cpu subtype mismatches if the core file header isn't written out completely accurately. We need to be a little loose in this particular case. <rdar://problem/17843388> llvm-svn: 216498
* [libcxx] Fix ctype_byname<wchar_t>::do_is() mask checking.Jonathan Roelofs2014-08-261-30/+30
| | | | | | | This patch: http://reviews.llvm.org/D5081 Original patch: http://reviews.llvm.org/D5071 (from @danalbert) llvm-svn: 216497
* Revert 216491, it breaks CodeGenCXX/microsoft-abi-member-pointers.cppJulien Lerouge2014-08-263-19/+4
| | | | llvm-svn: 216496
* Don't segfault in EmitCXXGlobalInitFunc when main file is a membufKeno Fischer2014-08-266-7/+130
| | | | | | | | | | | | | | Summary: When the main file is created from a membuffer, there is no file entry that can be retrieved. This uses "__GLOBAL_I_a" in that case which is what was always used before r208128. Reviewers: majnemer, thakis Reviewed By: thakis Subscribers: yaron.keren, rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D5043 llvm-svn: 216495
* [asan] add a test for poison_array_cookie=1Kostya Serebryany2014-08-261-0/+19
| | | | llvm-svn: 216494
* Update for llvm api change.Rafael Espindola2014-08-261-2/+1
| | | | llvm-svn: 216493
* Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.Rafael Espindola2014-08-268-22/+22
| | | | | | | By taking a reference we can do the ownership transfer in one place instead of expecting every caller to do it. llvm-svn: 216492
* Win64 ABI shouldn't extend integer type arguments.Julien Lerouge2014-08-263-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: MSVC doesn't extend integer types smaller than 64bit, so to preserve binary compatibility, clang shouldn't either. For example, the following C code built with MSVC: unsigned test(unsigned v); unsigned foobar(unsigned short); int main() { return test(0xffffffff) + foobar(28); } Produces the following: 0000000000000004: B9 FF FF FF FF mov ecx,0FFFFFFFFh 0000000000000009: E8 00 00 00 00 call test 000000000000000E: 89 44 24 20 mov dword ptr [rsp+20h],eax 0000000000000012: 66 B9 1C 00 mov cx,1Ch 0000000000000016: E8 00 00 00 00 call foobar And as you can see, when setting up the call to foobar, only cx is overwritten. If foobar is compiled with clang, then the zero extension added by clang means the rest of the register, which contains garbage, could be used. For example if foobar is: unsigned foobar(unsigned short v) { return v; } Compiled with clang -fomit-frame-pointer -O3 gives the following assembly: foobar: 0000000000000000: 89 C8 mov eax,ecx 0000000000000002: C3 ret And that function would return garbage because the 16 most significant bits of ecx still contain garbage from the first call. With this change, the code for that function is now: foobar: 0000000000000000: 0F B7 C1 movzx eax,cx 0000000000000003: C3 ret Reviewers: chapuni, rnk Reviewed By: rnk Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4380 llvm-svn: 216491
* Clarify comment so this doesn't appear to be a C11-only rule.Richard Smith2014-08-261-0/+3
| | | | llvm-svn: 216490
* Update for llvm api changeRafael Espindola2014-08-261-1/+1
| | | | llvm-svn: 216489
* Pass a MemoryBufferRef when we can avoid taking ownership.Rafael Espindola2014-08-2616-71/+58
| | | | | | | | | | | | | The attached patch simplifies a few interfaces that don't need to take ownership of a buffer. For example, both parseAssembly and parseBitcodeFile will parse the entire buffer before returning. There is no need to take ownership. Using a MemoryBufferRef makes it obvious in the type signature that there is no ownership transfer. llvm-svn: 216488
* It was pointed out to me that an offset of 0 makes sense for ObjC, but not ↵Enrico Granata2014-08-262-4/+3
| | | | | | always for C++, and this API claims to be general enough that it should not drop C++ usability on the floor for no good reason. Fix it with an explicit offset argument llvm-svn: 216487
* [dwarf] Add new language enumerations.Bruce Mitchener2014-08-262-0/+6
| | | | | | | This updates the DWARF language identifiers to include recent additions to the DWARF 5 specification (draft). llvm-svn: 216486
* revert patch r216469.Fariborz Jahanian2014-08-266-5/+6
| | | | llvm-svn: 216485
* Give ExecutionEngine of top level buffers.Rafael Espindola2014-08-265-6/+14
| | | | | | | Long term the idea if for the engine to not own the buffers, but for now this is consistent with the rest of the API. llvm-svn: 216484
* Add an API on ValueObject to generate a 'synthetic child' of base class ↵Enrico Granata2014-08-262-0/+45
| | | | | | type. Note that in this commit, the term synthetic child is not meant to refer to data formatters, but to the programmatically-generated children stored inside a ValueObject itself llvm-svn: 216483
* Remove strict dependency on llvm-config.Dan Albert2014-08-261-22/+20
| | | | | | | | | | | | | | | | | Depending on llvm-config allows for a few nice things (auto-detecting LLVM source tree, version numbers, etc), but it's makes bootstrapping a pain. Keep the llvm-config features around, but also fall back to being able to configure based on -DLLVM_PATH=path/to/llvm. Reviewers: jroelofs, loladiro Reviewed By: loladiro Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5016 llvm-svn: 216482
* MC: Split the x86 asm matcher implementations by dialectReid Kleckner2014-08-265-33/+296
| | | | | | | | | | | | | | | | | | | The existing matcher has lots of AT&T assembly dialect assumptions baked into it. In particular, the hack for resolving the size of a memory operand by appending the four most common suffixes doesn't work at all. The Intel assembly dialect mnemonic table has ambiguous entries, so we need to try matching multiple times with different operand sizes, since that's the only way to choose different instruction variants. This makes us more compatible with gas's implementation of Intel assembly syntax. MSVC assumes you want byte-sized operations for the instructions that we reject as ambiguous. Reviewed By: grosbach Differential Revision: http://reviews.llvm.org/D4747 llvm-svn: 216481
* [libclang] Fixup the cursor spelling range for C++ destructors, operator ↵Argyrios Kyrtzidis2014-08-262-0/+127
| | | | | | | | overloads, and conversion functions. Patch by Craig Tenenbaum! llvm-svn: 216480
* Fix an incorrect assert condition added in r216410.Alexey Samsonov2014-08-261-1/+1
| | | | llvm-svn: 216479
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-262-7/+7
| | | | llvm-svn: 216478
* Ignore -fdevirtualize and -fdevirtualize-speculatively for gcc compatReid Kleckner2014-08-262-0/+7
| | | | llvm-svn: 216477
* Return a std::unique_ptr from getBufferForFile. NFC.Rafael Espindola2014-08-2611-39/+37
| | | | llvm-svn: 216476
* Revert r210342 and r210343, add test case for the crasher.Joerg Sonnenberger2014-08-263-132/+19
| | | | | | PR 20642. llvm-svn: 216475
* [test/CodeGen/ARM] Update arm_neon_intrinsics test case to actually test theQuentin Colombet2014-08-261-22/+82
| | | | | | | | | lowering of the intrinsics. Prior to this commit, most of the copy-related intrinsics could be optimized away. The situation is still not ideal as there are several possibilities to lower a given intrinsic. Currently, we match LLVM behavior. llvm-svn: 216474
OpenPOWER on IntegriCloud