summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* AVX-512: Changed CC parameter in "cmp" intrinsicElena Demikhovsky2015-05-114-285/+285
| | | | | | from i8 to i32 according to the Intel Spec llvm-svn: 236980
* [MS ABI] Import move assignment operatorsDavid Majnemer2015-05-111-2/+4
| | | | | | | MSVC 2015 changed behavior from 2013; it imports move assignment operators. llvm-svn: 236966
* [MS ABI] Form member pointers from virtual funcs overriding vbasesDavid Majnemer2015-05-101-0/+12
| | | | | | | | | | | | | | | We didn't supporting taking the address of virtual member functions which overrode a method in a virtual base. We simply need to encode the virtual base index in the member pointer. This fixes PR23452. N.B. There is no data member pointer side to this change because taking the address of a virtual bases' data member gives you a member pointer whose type is derived from the virtual bases' type, not the most derived type. llvm-svn: 236962
* [MS ABI] Update EH emission for MSVC 2015 compatibilityDavid Majnemer2015-05-101-0/+15
| | | | | | | | | | | | | MSVC 2015 renamed the symbol found by name lookup for 'std::terminate' so we cannot rely on using '?terminate@@YAXXZ'. Furthermore, it seems that 2015 will be the first release of MSVC which permits inlining a function which is noexcept into a function which isn't. This is implemented by creating a cleanup for the invoker which jumps to __std_terminate. Clang's implementation of this aspect of the MSVC scheme is slightly less efficient in this respect because we use a catch handler configured as a catch-all handler instead. llvm-svn: 236961
* Reapply r236854 and fixed r236867.Daniel Jasper2015-05-102-1/+9
| | | | | | | Makes emacs show a different message when clang-format encountered a syntax error. llvm-svn: 236943
* Revert r236879, "Do not emit thunks with available_externally linkage in ↵NAKAMURA Takumi2015-05-091-26/+1
| | | | | | | | comdats" It broke pecoff, at least i686-cygwin. llvm-svn: 236937
* Revert "Make emacs show when clang-format encountered a syntax error."Tobias Grosser2015-05-082-9/+1
| | | | | | | | | | | This reverts commit 236854, which caused clang-format to always print '{ "IncompleteFormat": false }' at the top of an incompletely formatted file. This output causes problems e.g. in Polly's automatic formatting checks. Daniel tried to fix this in 236867, but this fix had to be reverted due to buildbot failures. I revert this change as well for now as it is Friday night and unlikely to be fixed immediately. llvm-svn: 236908
* Using ARMTargetParser in ClangRenato Golin2015-05-081-7/+6
| | | | | | | | | | | | | | | | This is a starting point for using the TargetParser in Clang, in a simple enough part of the code that can be used without disrupting the crazy platform support that we need to be compatible with other toolchains. Also adding a few FIXME on obvious places that need replacing, but those cases will indeed break a few of the platform assumptions, as arch/cpu names change multiple times in the driver. Finally, I'm changing the "neon-vfpv3" behaviour to match standard NEON, since -mfpu=neon implies vfpv3 by default in both Clang and LLVM. That option string is still supported as an alias to "neon". llvm-svn: 236901
* Fix BackendConsumer::EmitOptimizationMessage()Diego Novillo2015-05-081-0/+21
| | | | | | | | | | | Patch from Geoff Berry <gberry@codeaurora.org> Fix BackendConsumer::EmitOptimizationMessage() to check if the DiagnosticInfoOptimizationBase object has a valid location before calling getLocation() to avoid dereferencing a null pointer inside getLocation() when no debug info is present. llvm-svn: 236898
* Add the test case from PR 14044 to ensure it doesn't regress.Kaelyn Takata2015-05-081-0/+12
| | | | | | | The test started working at some point, presumably fixed through the delayed typo correction work. llvm-svn: 236883
* Revert "clang-format: Only output IncompleteFormat if -cursor is given."Renato Golin2015-05-081-2/+2
| | | | | | | This reverts commit r236867, as it was breaking multiple buildbots. Daniel will look into it later. llvm-svn: 236882
* Do not emit thunks with available_externally linkage in comdatsDerek Schuff2015-05-081-1/+26
| | | | | | | | | | | | | | Functions with available_externally linkage will not be emitted to object files (they will just be undefined symbols), so it does not make sense to put them in comdats. Creates a second overload of maybeSetTrivialComdat that uses the GlobalObject instead of the Decl, and uses that in several places that had the faulty logic. Differential Revision: http://reviews.llvm.org/D9580 llvm-svn: 236879
* Revert "Allow case-insensitive values for -mcpu for ARM and AArch64"Renato Golin2015-05-082-22/+0
| | | | | | | This reverts commit r236859, as it broke multiple builds. I'll investigate and reapply when safe. llvm-svn: 236869
* clang-format: Only output IncompleteFormat if -cursor is given.Daniel Jasper2015-05-081-2/+2
| | | | | | This is only for editor integrations. llvm-svn: 236867
* Allow case-insensitive values for -mcpu for ARM and AArch64Renato Golin2015-05-082-0/+22
| | | | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option. Patch by Gabor Ballabas. llvm-svn: 236859
* Make emacs show when clang-format encountered a syntax error.Manuel Klimek2015-05-082-1/+9
| | | | | | | Propagate the 'incomplete-format' state back through clang-format's command line interace and adapt the emacs integration to show a better result. llvm-svn: 236854
* [ARM] Give an error on invalid -march valuesJohn Brawn2015-05-081-3/+3
| | | | | | | | | | llvm::Triple::getARMCPUForArch now returns nullptr for invalid -march values, instead of silently translating it to arm7tdmi. Use this to give an error message, which is consistent with how gcc behaves. Differential Revision: http://reviews.llvm.org/D9602 llvm-svn: 236846
* [OPENMP] Fixed atomic construct with non-integer expressions.Alexey Bataev2015-05-081-0/+3
| | | | | | Do not emit 'atomicrmw' instruction for simple atomic constructs with non-integer expressions. llvm-svn: 236828
* [OPENMP] Code cleanup for capturing of variables in OpenMP regions.Alexey Bataev2015-05-081-1/+14
| | | | llvm-svn: 236821
* [SanitizerCoverage] Implement user-friendly -fsanitize-coverage= flags.Alexey Samsonov2015-05-071-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Possible coverage levels are: * -fsanitize-coverage=func - function-level coverage * -fsanitize-coverage=bb - basic-block-level coverage * -fsanitize-coverage=edge - edge-level coverage Extra features are: * -fsanitize-coverage=indirect-calls - coverage for indirect calls * -fsanitize-coverage=trace-bb - tracing for basic blocks * -fsanitize-coverage=trace-cmp - tracing for cmp instructions * -fsanitize-coverage=8bit-counters - frequency counters Levels and features can be combined in comma-separated list, and can be disabled by subsequent -fno-sanitize-coverage= flags, e.g.: -fsanitize-coverage=bb,trace-bb,8bit-counters -fno-sanitize-coverage=trace-bb is equivalient to: -fsanitize-coverage=bb,8bit-counters Original semantics of -fsanitize-coverage flag is preserved: * -fsanitize-coverage=0 disables the coverage * -fsanitize-coverage=1 is a synonym for -fsanitize-coverage=func * -fsanitize-coverage=2 is a synonym for -fsanitize-coverage=bb * -fsanitize-coverage=3 is a synonym for -fsanitize-coverage=edge * -fsanitize-coverage=4 is a synonym for -fsanitize-coverage=edge,indirect-calls Driver tries to diagnose invalid flag usage, in particular: * At most one level (func,bb,edge) must be specified. * "trace-bb" and "8bit-counters" features require some level to be specified. See test case for more examples. Test Plan: regression test suite Reviewers: kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9577 llvm-svn: 236790
* [MS ABI] Make sure we number thread_local statics seperatelyDavid Majnemer2015-05-071-1/+11
| | | | | | | The thread_local variables need their own numbers, they can't share with the other static local variables. llvm-svn: 236774
* Fixed test failure on machines with 32-bit size_t.Artem Belevich2015-05-071-1/+1
| | | | llvm-svn: 236773
* [cuda] Include GPU binary into host object file and generate init/deinit code.Artem Belevich2015-05-071-1/+40
| | | | | | | | | | | | - added -fcuda-include-gpubinary option to incorporate results of device-side compilation into host-side one. - generate code to register GPU binaries and associated kernels with CUDA runtime and clean-up on exit. - added test case for init/deinit code generation. Differential Revision: http://reviews.llvm.org/D9507 llvm-svn: 236765
* Replace the broken LambdaCapture::isInitCapture API.James Dennett2015-05-071-1/+24
| | | | | | | | | | | | | | | A LambdaCapture does not have sufficient information to correctly determine whether it is an init-capture or not. Doing so requires knowledge held in the LambdaExpr itself. It the case of a nested capture of an init-capture it is not sufficient to check (as LambdaCapture::isInitCapture did) whether the associated VarDecl was from an init-capture. This patch moves isInitCapture to LambdaExpr and updates Capture->isInitCapture() to Lambda->isInitCapture(Capture). llvm-svn: 236760
* [SanitizerCoverage] Give clang-cc1 the power to precisly specify needed ↵Alexey Samsonov2015-05-072-26/+26
| | | | | | | | | | | | | | | | | | sanitizier coverage mode. Summary: The next step is to add user-friendly control over these options to driver via -fsanitize-coverage= option. Test Plan: regression test suite Reviewers: kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9545 llvm-svn: 236756
* AVX-512: FP compare intrinsics - changed type of CC parameter from i8 to i32 ↵Elena Demikhovsky2015-05-071-0/+47
| | | | | | | | according to the spec. Added FP compare intrinsics for SKX. llvm-svn: 236715
* Mark clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp as ↵NAKAMURA Takumi2015-05-071-0/+2
| | | | | | REQUIRES:asserts. It relies on label names. llvm-svn: 236709
* Fix for http://llvm.org/PR23392: magick/feature.c from ImageMagick-6.9.1-2 ICEs.Alexey Bataev2015-05-072-4/+13
| | | | | | | Fix for codegen of static variables declared inside of captured statements. Captured statements are actually a transparent DeclContexts, so we have to skip them when trying to get a mangled name for statics. Differential Revision: http://reviews.llvm.org/D9522 llvm-svn: 236701
* [MS ABI] Implement thread-safe initialization using the MSVC 2015 ABIDavid Majnemer2015-05-074-13/+94
| | | | | | | | | The MSVC 2015 ABI utilizes a rather straightforward adaptation of the algorithm found in the appendix of N2382. While we are here, implement support for emitting cleanups if an exception is thrown while we are intitializing a static local variable. llvm-svn: 236697
* [OPENMP] Generate !llvm.mem.loop_parallel_access metadata for loops with ↵Alexey Bataev2015-05-072-2/+11
| | | | | | | | | | dynamic/guided scheduling. Inner bodies of OpenMP worksharing loop-based constructs with dynamic or guided scheduling are allowed to be marked with !llvm.mem.parallel_loop_access metadata for better optimization. Worksharing constructs with static scheduling cannot be marked this way (according to OpenMP standard "A data dependence between the same logical iterations in two such loops is guaranteed"). Constructs with auto and runtime scheduling are also not marked because automatically chosen scheduling may be static also. Differential Revision: http://reviews.llvm.org/D9518 llvm-svn: 236693
* [OPENMP] Fixed test for reduction on 'sections' directive.Alexey Bataev2015-05-071-1/+1
| | | | llvm-svn: 236692
* [modules] Suport for merging a parsed enum definition into an existing ↵Richard Smith2015-05-071-0/+7
| | | | | | imported but not visible definition. llvm-svn: 236690
* [OPENMP] Fixed codegen for 'reduction' clause.Alexey Bataev2015-05-073-104/+92
| | | | | | | | Fixed codegen for reduction operations min, max, && and ||. Codegen for them is quite similar and I was confused by this similarity. Also added a call to kmpc_end_reduce() in atomic part of reduction codegen (call to kmpc_end_reduce_nowait() is not required). Differential Revision: http://reviews.llvm.org/D9513 llvm-svn: 236689
* When performing delayed typo correction in a for-range loop's variableKaelyn Takata2015-05-071-0/+9
| | | | | | | declaration, ensure the loop variable is properly marked as invalid when it is an "auto" variable. llvm-svn: 236682
* Fix public-private.modulemap test case to clear the cache on every run.Peter Collingbourne2015-05-061-2/+3
| | | | llvm-svn: 236655
* [OPENMP] Fixed messages about predetermined DSA for loop control variables.Alexey Bataev2015-05-061-1/+1
| | | | llvm-svn: 236574
* [OPENMP] Fix for http://llvm.org/PR23387: clang fails to compile ↵Alexey Bataev2015-05-061-0/+18
| | | | | | | | magick/attribute.c Allow to use variables with 'register' storage class as loop control variables in OpenMP loop based constructs. llvm-svn: 236571
* InstrProf: Don't start or end coverage regions inside of system macrosJustin Bogner2015-05-051-0/+12
| | | | | | | | | | | It doesn't make much sense to try to show coverage inside system macros, and source locations in builtins confuses the coverage mapping. Just avoid doing this. Fixes an assert that fired when a __block storage specifier starts a region. llvm-svn: 236547
* Update testcase to match r236539David Majnemer2015-05-051-1/+1
| | | | llvm-svn: 236542
* [SystemZ] Add support for z13 low-level vector builtinsUlrich Weigand2015-05-052-0/+784
| | | | | | | | | | | | | | | | | | | | | | | | | This adds low-level builtins to allow access to all of the z13 vector instructions. Note that instructions whose semantics can be described by standard C (including clang extensions) do not get any builtins. For each instructions whose semantics *cannot* (fully) be described, we define a builtin named __builtin_s390_<insn> that directly maps to this instruction. These are intended to be compatible with GCC. For instructions that also set the condition code, the builtin will take an extra argument of type "int *" at the end. The integer pointed to by this argument will be set to the post-instruction CC value. For many instructions, the low-level builtin is mapped to the corresponding LLVM IR intrinsic. However, a number of instructions can be represented in standard LLVM IR without requiring use of a target intrinsic. Some instructions require immediate integer operands within a certain range. Those are verified at the Sema level. Based on a patch by Richard Sandiford. llvm-svn: 236532
* [SystemZ] Add support for z13 and its vector facilityUlrich Weigand2015-05-054-3/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the z13 architecture type. For compatibility with GCC, a pair of options -mvx / -mno-vx can be used to selectively enable/disable use of the vector facility. When the vector facility is present, we default to the new vector ABI. This is characterized by two major differences: - Vector types are passed/returned in vector registers (except for unnamed arguments of a variable-argument list function). - Vector types are at most 8-byte aligned. The reason for the choice of 8-byte vector alignment is that the hardware is able to efficiently load vectors at 8-byte alignment, and the ABI only guarantees 8-byte alignment of the stack pointer, so requiring any higher alignment for vectors would require dynamic stack re-alignment code. However, for compatibility with old code that may use vector types, when *not* using the vector facility, the old alignment rules (vector types are naturally aligned) remain in use. These alignment rules are not only implemented at the C language level, but also at the LLVM IR level. This is done by selecting a different DataLayout string depending on whether the vector ABI is in effect or not. Based on a patch by Richard Sandiford. llvm-svn: 236531
* Allow TransformTypos to ignore corrections to a specified VarDecl.Kaelyn Takata2015-05-051-0/+8
| | | | | | | | | | | | | This is needed to prevent a TypoExpr from being corrected to a variable when the TypoExpr is a subexpression of that variable's initializer. Also exclude more keywords from the correction candidate pool when the subsequent token is .* or ->* since keywords like "new" or "return" aren't valid on the left side of those operators. Fixes PR23140. llvm-svn: 236519
* [OPENMP] Allow use of macros in OpenMP directives/clauses.Alexey Bataev2015-05-051-0/+4
| | | | llvm-svn: 236493
* [OPENMP] Codegen for 'firstprivate' clause in 'task' directive.Alexey Bataev2015-05-051-0/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tasks codegen for private/firstprivate variables are different rather than for other directives. 1. Build an internal structure of privates for each private variable: struct .kmp_privates_t. { Ty1 var1; ... Tyn varn; }; 2. Add a new field to kmp_task_t type with list of privates. struct kmp_task_t { void * shareds; kmp_routine_entry_t routine; kmp_int32 part_id; kmp_routine_entry_t destructors; .kmp_privates_t. privates; }; 3. Create a function with destructors calls for all privates after end of task region. kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) { ~Destructor(&tt->privates.var1); ... ~Destructor(&tt->privates.varn); return 0; } 4. Perform initialization of all firstprivate fields (by simple copying for POD data, copy constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls. kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry); CopyConstructor(new_task->privates.var1, *new_task->shareds.var1_ref); new_task->shareds.var1_ref = &new_task->privates.var1; ... CopyConstructor(new_task->privates.varn, *new_task->shareds.varn_ref); new_task->shareds.varn_ref = &new_task->privates.varn; new_task->destructors = .omp_task_destructor.; kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task) Differential Revision: http://reviews.llvm.org/D9370 llvm-svn: 236479
* Fix buffer overflow in LexerKostya Serebryany2015-05-041-0/+8
| | | | | | | | | | | | | | | | | | | | | Summary: Fix PR22407, where the Lexer overflows the buffer when parsing #include<\ (end of file after slash) Test Plan: Added a test that will trigger in asan build. This case is also covered by the clang-fuzzer bot. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9489 llvm-svn: 236466
* [MS ABI] Fix a crash in vptr path calculationDavid Majnemer2015-05-042-1/+30
| | | | | | | | | | | | | I discovered a case where the old algorithm would crash. Instead of trying to patch the algorithm, rewrite it. The new algorithm operates in three phases: 1. Find all paths to the subobject with the vptr. 2. Remove paths which are subsets of other paths. 3. Select the best path where 'best' is defined as introducing the most covariant overriders. If two paths introduce different overriders, raise a diagnostic. llvm-svn: 236444
* Instantiate incomplete class used in template method.Serge Pavlov2015-05-041-0/+129
| | | | | | | | | | | If a class is absent from instantiation and is incomplete, instantiate it as an incomplete class thus avoiding compiler crash. This change fixes PR18653. Differential Revision: http://reviews.llvm.org/D8281 llvm-svn: 236426
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-041-0/+1
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* [MS ABI] Add testcase which was missing from r236354David Majnemer2015-05-021-0/+44
| | | | | | | This test verifies that we can detect when the inheritance paths are ambiguous due to covariant thunks, ensuring we don't regress PR16759. llvm-svn: 236381
* Diagnose delayed typos when parsing a postfix expression with anKaelyn Takata2015-05-021-0/+6
| | | | | | | | unmatched l_paren before setting the LHS to ExprError(). Fixes PR23285. llvm-svn: 236371
OpenPOWER on IntegriCloud