summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Properly track the found declaration (possibly a using-declaration) whenRichard Smith2016-05-241-2/+7
| | | | | | handling an explicit member specialization. llvm-svn: 270514
* [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IRSimon Pilgrim2016-05-232-4/+6
| | | | | | | | | | Both the (V)CVTDQ2PD(Y) (i32 to f64) and (V)CVTPS2PD(Y) (f32 to f64) conversion instructions are lossless and can be safely represented as generic __builtin_convertvector calls instead of x86 intrinsics without affecting final codegen. This patch removes the clang builtins and their use in the sse2/avx headers - a future patch will deal with removing the llvm intrinsics, but that will require a bit more work. Differential Revision: http://reviews.llvm.org/D20528 llvm-svn: 270499
* [CUDA] Add -fcuda-approx-transcendentals flag.Justin Lebar2016-05-234-0/+27
| | | | | | | | | | | | | | Summary: This lets us emit e.g. sin.approx.f32. See http://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin Reviewers: rnk Subscribers: tra, cfe-commits Differential Revision: http://reviews.llvm.org/D20493 llvm-svn: 270484
* Fix filtering of prior declarations when checking for a tag redeclaration toRichard Smith2016-05-231-1/+2
| | | | | | | map to the redecl context for both decls, not just one of them, and to properly check that the decl contexts are equivalent. llvm-svn: 270482
* Clang support for __is_assignable intrinsicDavid Majnemer2016-05-234-0/+7
| | | | | | | | | | | | | | | | | | | MSVC now supports the __is_assignable type trait intrinsic, to enable easier and more efficient implementation of the Standard Library's is_assignable trait. As of Visual Studio 2015 Update 3, the VC Standard Library implementation uses the new intrinsic unconditionally. The implementation is pretty straightforward due to the previously existing is_nothrow_assignable and is_trivially_assignable. We handle __is_assignable via the same code as the other two except that we skip the extra checks for nothrow or triviality. Patch by Dave Bartolomeo! Differential Revision: http://reviews.llvm.org/D20492 llvm-svn: 270458
* [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)David Majnemer2016-05-233-18/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The layout_version attribute is pretty straightforward: use the layout rules from version XYZ of MSVC when used like struct __declspec(layout_version(XYZ)) S {}; The empty_bases attribute is more interesting. It tries to get the C++ empty base optimization to fire more often by tweaking the MSVC ABI rules in subtle ways: 1. Disable the leading and trailing zero-sized object flags if a class is marked __declspec(empty_bases) and is empty. This means that given: struct __declspec(empty_bases) A {}; struct __declspec(empty_bases) B {}; struct C : A, B {}; 'C' will have size 1 and nvsize 0 despite not being annotated __declspec(empty_bases). 2. When laying out virtual or non-virtual bases, disable the injection of padding between classes if the most derived class is marked __declspec(empty_bases). This means that given: struct A {}; struct B {}; struct __declspec(empty_bases) C : A, B {}; 'C' will have size 1 and nvsize 0. 3. When calculating the offset of a non-virtual base, choose offset zero if the most derived class is marked __declspec(empty_bases) and the base is empty _and_ has an nvsize of 0. Because of the ABI rules, this does not mean that empty bases reliably get placed at offset 0! For example: struct A {}; struct B {}; struct __declspec(empty_bases) C : A, B { virtual ~C(); }; 'C' will be pointer sized to account for the vfptr at offset 0. 'A' and 'B' will _not_ be at offset 0 despite being empty! Instead, they will be located right after the vfptr. This occurs due to the interaction betweeen non-virtual base layout and virtual function pointer injection: injection occurs after the nv-bases and shifts them down by the size of a pointer. llvm-svn: 270457
* [clang][AVX512][Builtin] adding missing intrinsics for ↵Michael Zuckerman2016-05-232-1/+90
| | | | | | | | vpmultishiftqb{128|256|512} instruction set . Differential Revision: http://reviews.llvm.org/D20521 llvm-svn: 270441
* Test commitJacob Baungard Hansen2016-05-231-0/+1
| | | | llvm-svn: 270435
* [Clang][AVX512][BUILTIN]adding missing intrinsics for movdaq instruction setMichael Zuckerman2016-05-232-0/+88
| | | | | | Differential Revision: http://reviews.llvm.org/D20514 llvm-svn: 270401
* Driver: support exherbo's multiarch supportSaleem Abdulrasool2016-05-231-26/+59
| | | | | | | | Exherbo has an alternative file system layout to accommodate multiarch. The loader is located at /usr/${triple}/lib/${loader}. Adjust the Linux toolchain to support that on exherbo. llvm-svn: 270392
* [driver][mips] clang-format the code. NFCSimon Atanasyan2016-05-221-27/+27
| | | | llvm-svn: 270374
* [driver][mips] Support new versions of MIPS CodeScape toolchainsSimon Atanasyan2016-05-221-6/+173
| | | | llvm-svn: 270373
* [driver][mips] Use target triple mips-mti-linux-gnu for toolchain detectionSimon Atanasyan2016-05-221-13/+15
| | | | llvm-svn: 270368
* [driver][mips] Rename some variables to better reflect their purpose. NFCSimon Atanasyan2016-05-221-8/+9
| | | | llvm-svn: 270367
* [driver][mips] Drop support for outdated version of CodeSourcery MIPS toolchainSimon Atanasyan2016-05-221-56/+1
| | | | llvm-svn: 270366
* [AST] Cleanup comments regarding CXXRecordDecl::isEmptyDavid Majnemer2016-05-221-8/+11
| | | | | | | | | We were missing references to the standard, some of our home-grown verbiage didn't make any sense. No functional change is intended. llvm-svn: 270353
* Driver: sink getLinuxDynamicLoader into the ToolchainSaleem Abdulrasool2016-05-223-70/+72
| | | | | | | | The parameter already requires the toolchain, sink the method into the class. This also enables the use of the distro detection logic which will be needed to support Exherbo's multiarch approach. llvm-svn: 270352
* Driver: simplify getDynameLinkerSaleem Abdulrasool2016-05-221-47/+49
| | | | | | | | Convert the cascading if/else to a switch. This makes it easier to follow the logic. Minor difference is that we no longer default to x86_64 but rather to the architecture specified by the architecture. llvm-svn: 270351
* [X86][AVX] Ensure zero-extension of _mm256_extract_epi8 and _mm256_extract_epi16Simon Pilgrim2016-05-211-5/+5
| | | | | | | | | | Ensure _mm256_extract_epi8 and _mm256_extract_epi16 zero extend their i8/i16 result to i32. This matches _mm_extract_epi8 and _mm_extract_epi16. Fix for PR27594 Differential Revision: http://reviews.llvm.org/D20468 llvm-svn: 270330
* [OpenCL] Add to_{global|local|private} builtin functions.Yaxun Liu2016-05-202-0/+75
| | | | | | | | | | | | | | | | | | OpenCL builtin functions to_{global|local|private} accepts argument of pointer type to arbitrary pointee type, and return a pointer to the same pointee type in different addr space, i.e. global gentype *to_global(gentype *p); It is not desirable to declare it as global void *to_global(void *); in opencl header file since it misses diagnostics. This patch implements these builtin functions as Clang builtin functions. In the builtin def file they are defined to have signature void*(void*). When handling call expressions, their declarations are re-written to have correct parameter type and return type corresponding to the call argument. In codegen call to addr void *to_addr(void*) is generated with addrcasts or bitcasts to facilitate implementation in builtin library. Differential Revision: http://reviews.llvm.org/D19932 llvm-svn: 270261
* ObjectiveC: canonicalize "kindof id" to "id".Manman Ren2016-05-201-4/+5
| | | | | | | | There is no need to apply kindof on an unqualified id type. rdar://24753825 llvm-svn: 270241
* Make __FreeBSD_cc_version predefined macro configurable at build timeDimitry Andric2016-05-201-2/+9
| | | | | | | | | | | | | | | | | | The `FreeBSDTargetInfo` class has always set the `__FreeBSD_cc_version` predefined macro to a rather static value, calculated from the major OS version. In the FreeBSD base system, we will start incrementing the value of this macro whenever we make any signifant change to clang, so we need a way to configure the macro's value at build time. Use `FREEBSD_CC_VERSION` for this, which we can define in the FreeBSD build system using either the `-D` command line option, or an include file. Stock builds will keep the earlier value. Differential Revision: http://reviews.llvm.org/D20037 llvm-svn: 270240
* [OpenCL] Allow explicit cast of 0 to event_t.Yaxun Liu2016-05-201-0/+16
| | | | | | | | Patch by Aaron Enye Shi. Differential Revision: http://reviews.llvm.org/D17578 llvm-svn: 270238
* Eliminate unnecessary file access checks in Clang driver on WindowsAdrian McCarthy2016-05-201-1/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D20454 llvm-svn: 270226
* Add all the avx512 flavors to __builtin_cpu_supports's list.Benjamin Kramer2016-05-202-0/+32
| | | | | | | | This is matching what trunk gcc is accepting. Also adds a missing ssse3 case. PR27779. The amount of duplication here is annoying, maybe it should be factored into a separate .def file? llvm-svn: 270224
* [Hexagon] Recognize "s" constraint in inline-asmKrzysztof Parzyszek2016-05-201-0/+3
| | | | llvm-svn: 270216
* clang-format: [JS] sort ES6 imports.Martin Probst2016-05-209-781/+1390
| | | | | | | | | | | | | | | | | | Summary: This change automatically sorts ES6 imports and exports into four groups: absolute imports, parent imports, relative imports, and then exports. Exports are sorted in the same order, but not grouped further. To keep JS import sorting out of Format.cpp, this required extracting the TokenAnalyzer infrastructure to separate header and implementation files. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20198 llvm-svn: 270203
* clang-format: [JS] Treat "for" as a reserved word after a ".".Daniel Jasper2016-05-201-0/+3
| | | | | | | | Otherwise, clang-format can get confused with statements like: x.for = 1; llvm-svn: 270188
* CodeGen: address -Wcast-qual warningSaleem Abdulrasool2016-05-201-1/+1
| | | | | | Add a const_cast rather than the C-style cast. NFC. llvm-svn: 270180
* Re-alphabetize this file list.Richard Smith2016-05-201-10/+10
| | | | llvm-svn: 270170
* Revert incorrect module map changes in r269907 and replace them with theRichard Smith2016-05-201-4/+1
| | | | | | appropriate changes. llvm-svn: 270169
* [Lexer] Don't merge macro args from different macro filesVedant Kumar2016-05-191-0/+3
| | | | | | | | | | | | | | | | | | The lexer sets the end location of macro arguments incorrectly *if*, while merging consecutive args to fit into a single SLocEntry, it finds args which come from different macro files. Fix the issue by using separate SLocEntries in this situation. This fixes a code coverage crasher (rdar://problem/26181005). Because the lexer reported end locations for certain macro args incorrectly, we would generate bogus coverage mappings with negative line offsets. Reviewed-by: akyrtzi Differential Revision: http://reviews.llvm.org/D20401 llvm-svn: 270160
* [analyzer] Fix for PR23790 : constrain return value of strcmp() rather than ↵Anton Yartsev2016-05-191-17/+20
| | | | | | | | | | returning a concrete value. The function strcmp() can return any value, not just {-1,0,1} : "The strcmp(const char *s1, const char *s2) function returns an integer greater than, equal to, or less than zero, accordingly as the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2." [C11 7.24.4.2p3] https://llvm.org/bugs/show_bug.cgi?id=23790 http://reviews.llvm.org/D16317 llvm-svn: 270154
* [CUDA] Implement __ldg using intrinsics.Justin Lebar2016-05-194-1/+307
| | | | | | | | | | | | | | | | | | Summary: Previously it was implemented as inline asm in the CUDA headers. This change allows us to use the [addr+imm] addressing mode when executing ld.global.nc instructions. This translates into a 1.3x speedup on some benchmarks that call this instruction from within an unrolled loop. Reviewers: tra, rsmith Subscribers: jhen, cfe-commits, jholewinski Differential Revision: http://reviews.llvm.org/D19990 llvm-svn: 270150
* [Sema] Fix use after move. Found by ubsan.Benjamin Kramer2016-05-191-1/+2
| | | | llvm-svn: 270144
* [CUDA] Do not allow non-empty destructors for global device-side variables.Artem Belevich2016-05-192-1/+55
| | | | | | | | | | | | | | According to Cuda Programming guide (v7.5, E2.3.1): > __device__, __constant__ and __shared__ variables defined in namespace > scope, that are of class type, cannot have a non-empty constructor or a > non-empty destructor. Clang already deals with device-side constructors (see D15305). This patch enforces similar rules for destructors. Differential Revision: http://reviews.llvm.org/D20140 llvm-svn: 270108
* [CUDA] Enable fusing FP ops (-ffp-contract=fast) for CUDA by default.Artem Belevich2016-05-191-4/+9
| | | | | | | | | This matches default nvcc behavior and gives substantial performance boost on GPU where fmad is much cheaper compared to add+mul. Differential Revision: http://reviews.llvm.org/D20341 llvm-svn: 270094
* [MS ABI] Ignore transparent contexts when determining the effective contextDavid Majnemer2016-05-191-1/+1
| | | | | | | We didn't skip over extern "C++" contexts, causing us to mangle things which don't need to be mangled. llvm-svn: 270089
* Check for nullptr argument.Artem Belevich2016-05-191-2/+2
| | | | | | | | Addresses static analysis report in PR15492. Differential Revision: http://reviews.llvm.org/D20141 llvm-svn: 270086
* [CUDA] Allow sm_50,52,53 GPUsArtem Belevich2016-05-192-0/+19
| | | | | | | | LLVM accepts them since r233575. Differential Revision: http://reviews.llvm.org/D20405 llvm-svn: 270084
* [driver] Do not pass install dir to the MultilibSet include dirs callbackSimon Atanasyan2016-05-191-41/+25
| | | | | | | | All additional include directories are relative to the toolchain install folder. So let's do not pass this folder to each callback to simplify and slightly reduce the code. llvm-svn: 270069
* [driver] Do not pass target triple to the MultilibSet include dirs callbackSimon Atanasyan2016-05-191-10/+8
| | | | | | | No one callback uses target triple so we can escape passing the unused argument. llvm-svn: 270068
* [driver][mips] Hardcode triple name in case of CodeSourcery toolchain. NFCSimon Atanasyan2016-05-191-1/+1
| | | | | | | | CodeSourcery toolchain is a standalone toolchain which always uses the same triple name in its paths. It is independent from target triple used by the driver. llvm-svn: 270067
* [Clang][AVX512][intrinsics] continue completing missing set intrinsicsMichael Zuckerman2016-05-191-0/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D20160 llvm-svn: 270047
* [Sema] Allow an external sema source to handle delayed typo corrections.Benjamin Kramer2016-05-191-2/+10
| | | | | | | This probably isn't perfectly perfect but allows correcting function calls again. llvm-svn: 270039
* clang-format: [JS] Fix spacing in destructuring assignments.Daniel Jasper2016-05-191-1/+1
| | | | | | | | | | Before: const[a, b, c] = [1, 2, 3]; After: const [a, b, c] = [1, 2, 3]; llvm-svn: 270029
* clang-format: Fix incorrect indentation in last line of macro definitionDaniel Jasper2016-05-191-0/+2
| | | | | | | | | | | | | | | | | | Before: #define MACRO(a) \ if (a) { \ f(); \ } else \ g() After: #define MACRO(a) \ if (a) { \ f(); \ } else \ g() llvm-svn: 270028
* clang-format: Fix enumerator case ranges.Daniel Jasper2016-05-191-1/+2
| | | | | | | | | | Before: case a... b: break; After: case a ... b: break; llvm-svn: 270027
* Reapply^3 "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-193-10/+14
| | | | | | Sync up with "(llvm) Use Error in InstrProf and Coverage". llvm-svn: 270021
* Fix PR27601 by reverting [r267453] - Refactor traversal of bases in ↵Faisal Vali2016-05-192-35/+51
| | | | | | | | | | | | deduction of template parameters from base This reversal is being done with r267453's author's (i.e. Richard Smith's) permission. This fixes https://llvm.org/bugs/show_bug.cgi?id=27601 Also, per Richard's request the examples from the bug report have been added to our test suite. llvm-svn: 270016
OpenPOWER on IntegriCloud