summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [MS ABI] Form member pointers from virtual funcs overriding vbasesDavid Majnemer2015-05-102-12/+25
| | | | | | | | | | | | | | | 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-102-1/+19
| | | | | | | | | | | | | 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
* clang-format: Improve wrapping of << operators.Daniel Jasper2015-05-103-9/+14
| | | | | | | | | | | | | | | | | Before: llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; After: llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; Also, cleanup and simplify the operator wrapping logic. llvm-svn: 236960
* De-virtualize some const versions of getCanonicalDecl by redirecting to the ↵Craig Topper2015-05-103-11/+9
| | | | | | non-const version. Most of the Decl hierarchy already did it this way this just makes the rest consistent. llvm-svn: 236959
* clang-format: Preserve line break before } in __asm { ... }.Daniel Jasper2015-05-104-1/+15
| | | | | | | | Some compilers ignore everything after a semicolon in such inline asm blocks and thus, the closing brace must not be moved to the previous line. llvm-svn: 236946
* clang-format: Fix bug in escaped newline calculation.Daniel Jasper2015-05-102-1/+3
| | | | | | | This prevents clang-format from inadvertently joining stuff into macro definitions as reported in llvm.org/PR23466. llvm-svn: 236944
* Reapply r236854 and fixed r236867.Daniel Jasper2015-05-104-11/+30
| | | | | | | Makes emacs show a different message when clang-format encountered a syntax error. llvm-svn: 236943
* Prune trailing LF.NAKAMURA Takumi2015-05-091-1/+0
| | | | llvm-svn: 236938
* Revert r236879, "Do not emit thunks with available_externally linkage in ↵NAKAMURA Takumi2015-05-097-47/+28
| | | | | | | | comdats" It broke pecoff, at least i686-cygwin. llvm-svn: 236937
* Factor out Hexagon code to build args.Ikhlas Ajbar2015-05-091-8/+21
| | | | | | | This patch factor out the code in hexagon::Link::ConstructJob to be reused in other functions. No functionality change intended. llvm-svn: 236926
* Revert "Make emacs show when clang-format encountered a syntax error."Tobias Grosser2015-05-084-31/+12
| | | | | | | | | | | 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-083-51/+56
| | | | | | | | | | | | | | | | 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-082-7/+31
| | | | | | | | | | | 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-082-8/+8
| | | | | | | 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-087-28/+47
| | | | | | | | | | | | | | 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-084-27/+4
| | | | | | | 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-082-8/+8
| | | | | | This is only for editor integrations. llvm-svn: 236867
* Allow case-insensitive values for -mcpu for ARM and AArch64Renato Golin2015-05-084-4/+27
| | | | | | | | | 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-084-12/+31
| | | | | | | 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
* clang-format: Several improvements around formatting braced lists.Daniel Jasper2015-05-082-10/+33
| | | | | | | | | | | | | In particular: * If the difference between the longest and shortest element, we copped out of column format completely. Now, we instead allow to arrange these in a single column, essentially enforcing a one-per-line format. * Allow column layout even if there are braced lists. Especially, if there are many short lists, this can be beneficial. The bad case, where there is a long nested init list is usually caught as we now limit the length difference of the longest and shortest element. llvm-svn: 236851
* Fix for bug 23429.Nemanja Ivanovic2015-05-081-0/+8
| | | | | | | The macros for gcc atomic compare and swaps are defined for Power8 CPU's since the functionality is provided in the back end. llvm-svn: 236848
* [ARM] Give an error on invalid -march valuesJohn Brawn2015-05-082-4/+17
| | | | | | | | | | 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-082-4/+8
| | | | | | 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-085-126/+156
| | | | llvm-svn: 236821
* clang-format: [JS] Avoid bad line-warp around "function".Daniel Jasper2015-05-082-1/+7
| | | | | | | | | | | | | | | | | | | | Before: someLooooooooongFunction( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, function( aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) { // code }); After: someLooooooooongFunction( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, function(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) { // code }); llvm-svn: 236813
* clang-format: [JS] Fix regex literal detection.Daniel Jasper2015-05-082-1/+2
| | | | | | | | | | Before: var regex = /= / ; After: var regex = /=/; llvm-svn: 236811
* Revert "Fix path separator issue on Windows."Nikola Smiljanic2015-05-081-1/+3
| | | | | | This reverts commit 9242ff16b0460b488691fd70b42a2bf81a531e3a. llvm-svn: 236806
* Fix path separator issue on Windows.Nikola Smiljanic2015-05-081-3/+1
| | | | llvm-svn: 236804
* Update docs for SanitizerCoverage.Alexey Samsonov2015-05-072-17/+23
| | | | llvm-svn: 236793
* [SanitizerCoverage] Implement user-friendly -fsanitize-coverage= flags.Alexey Samsonov2015-05-075-20/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-074-14/+32
| | | | | | | 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-078-19/+277
| | | | | | | | | | | | - 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-078-12/+38
| | | | | | | | | | | | | | | 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-078-37/+79
| | | | | | | | | | | | | | | | | | 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
* [opaque pointer type] Correctly pass the pointee type when creating a GEP ↵David Blaikie2015-05-071-1/+2
| | | | | | constant expression llvm-svn: 236751
* Update the subversion link to http://subversion.apache.org/packages.html.Yaron Keren2015-05-071-2/+2
| | | | llvm-svn: 236734
* Fix clang getting started guide to require VC2013 instead of VS2012.Yaron Keren2015-05-071-2/+2
| | | | llvm-svn: 236733
* Adding new AST matcher: gnuNullExprSzabolcs Sipos2015-05-072-0/+9
| | | | | | It matches GNU __null expression. llvm-svn: 236731
* clang-format: Improve r236597, Properly indent method calls without inputs.Daniel Jasper2015-05-073-3/+9
| | | | | | | | | | | | Before: [aaaaaaaaaaaa(aaaaaa) aaaaaaaaaaaaaaaaaaaa]; After: [aaaaaaaaaaaa(aaaaaa) aaaaaaaaaaaaaaaaaaaa]; llvm-svn: 236730
* Implements a way to retrieve information about whether some lines were not ↵Manuel Klimek2015-05-075-42/+75
| | | | | | formatted due to syntax errors. llvm-svn: 236722
* AVX-512: FP compare intrinsics - changed type of CC parameter from i8 to i32 ↵Elena Demikhovsky2015-05-073-2/+92
| | | | | | | | 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 some glitches in the MSVCCompatibility documentDavid Majnemer2015-05-071-2/+2
| | | | | | | | - Fix the formatting of the "Exceptions and SEH" section. - Make the "Complete" text for "Thread-safe initialization of local statics" green. llvm-svn: 236706
* Fix for http://llvm.org/PR23392: magick/feature.c from ImageMagick-6.9.1-2 ICEs.Alexey Bataev2015-05-073-4/+15
| | | | | | | 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
* Note that we support 'throw' for the MS ABI.David Majnemer2015-05-071-2/+3
| | | | llvm-svn: 236698
* [MS ABI] Implement thread-safe initialization using the MSVC 2015 ABIDavid Majnemer2015-05-078-82/+310
| | | | | | | | | 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-073-2/+16
| | | | | | | | | | 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
OpenPOWER on IntegriCloud