summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Java annotation declaration being handled correctlyHans Wennborg2018-10-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, Java annotation declarations (@interface AnnotationName) were being handled as ObjC interfaces. This caused the brace formatting to mess up, so that when you had a class with an interface defined in it, it would indent the final brace of the class. It used to format this class like so: class A { @interface B {} } But will now just skip the @interface and format it like so: class A { @interface B {} } Patch by Sam Maier! Differential Revision: https://reviews.llvm.org/D53434 llvm-svn: 344789
* [Hexagon] Remove support for V4Krzysztof Parzyszek2018-10-191-11/+4
| | | | llvm-svn: 344786
* [ASTImporter] Removed uneeded default case label.Balazs Keri2018-10-191-2/+2
| | | | llvm-svn: 344784
* [ASTImporter] Added error handling for AST import.Balazs Keri2018-10-192-3305/+3962
| | | | | | | | | | | | | | | | | | | | | Summary: The goal of this change is to make the ASTImporter::Import functions return llvm::Expected instead of the imported type. As first part the ASTNodeImporter visit functions are updated to return with llvm::Expected. Various `import` functions are added to ASTNodeImporter to simplify the code and have a common place for interface towards ASTImporter (from ASTNodeImporter). There is some temporary code that is needed before ASTImporter is updated. Reviewers: a.sidorin, a_sidorin, xazax.hun Reviewed By: a_sidorin Subscribers: dkrupp, Szelethus, rnkovacs, martong, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51633 llvm-svn: 344783
* [COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsicsMandeep Singh Grang2018-10-183-0/+46
| | | | | | | | | | | | Reviewers: rnk, compnerd, mstorsjo, efriedma, TomTan, haripul, javed.absar Reviewed By: efriedma Subscribers: dmajor, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53115 llvm-svn: 344765
* [Diagnostics] Check for integer overflow in array size expressions David Bolvansky2018-10-182-1/+14
| | | | | | | | | | | | | | Summary: Fixes PR27439 Reviewers: rsmith, Rakete1111 Reviewed By: rsmith Subscribers: Rakete1111, cfe-commits Differential Revision: https://reviews.llvm.org/D52750 llvm-svn: 344759
* [OPENMP] Move OMPClausePrinter to OpenMPClause.h/OpenMPClause.cpp - NFC. ↵Patrick Lyster2018-10-182-451/+432
| | | | | | Differential Revision: https://reviews.llvm.org/D53102 llvm-svn: 344740
* Add support for -mno-tls-direct-seg-refs to ClangKristina Brooks2018-10-183-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch exposes functionality added in rL344723 to the Clang driver/frontend as a flag and adds appropriate metadata. Driver tests pass: ``` ninja check-clang-driver -snip- Expected Passes : 472 Expected Failures : 3 Unsupported Tests : 65 ``` Odd failure in CodeGen tests but unrelated to this: ``` ninja check-clang-codegen -snip- /SourceCache/llvm-trunk-8.0/tools/clang/test/CodeGen/builtins-wasm.c:87:10: error: cannot compile this builtin function yet -snip- Failing Tests (1): Clang :: CodeGen/builtins-wasm.c Expected Passes : 1250 Expected Failures : 2 Unsupported Tests : 120 Unexpected Failures: 1 ``` Original commit: [X86] Support for the mno-tls-direct-seg-refs flag Allows to disable direct TLS segment access (%fs or %gs). GCC supports a similar flag, it can be useful in some circumstances, e.g. when a thread context block needs to be updated directly from user space. More info and specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145 Patch by nruslan (Ruslan Nikolaev). Differential Revision: https://reviews.llvm.org/D53102 llvm-svn: 344739
* [TI removal] Test predicate rather than casting to detect a terminatorChandler Carruth2018-10-181-4/+5
| | | | | | and use the range based successor API. llvm-svn: 344730
* [AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.Eli Friedman2018-10-171-3/+2
| | | | | | | | "aarch64-none-elf" is commonly used for AArch64 baremetal toolchains. Differential Revision: https://reviews.llvm.org/D53348 llvm-svn: 344710
* [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with ↵Leonard Chan2018-10-171-0/+11
| | | | | | | | | | | | | -fsanitize=address Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the legacy to the new PassManager. This patch depends on https://reviews.llvm.org/D52739. Differential Revision: https://reviews.llvm.org/D52814 llvm-svn: 344699
* NFC: Remove trailing space from CodeGenModule.cppTakuto Ikuta2018-10-171-8/+8
| | | | llvm-svn: 344668
* AMDGPU: add __builtin_amdgcn_update_dppYaxun Liu2018-10-171-5/+9
| | | | | | | | | | Emit llvm.amdgcn.update.dpp for both __builtin_amdgcn_mov_dpp and __builtin_amdgcn_update_dpp. The first argument to llvm.amdgcn.update.dpp will be undef for __builtin_amdgcn_mov_dpp. Differential Revision: https://reviews.llvm.org/D52320 llvm-svn: 344665
* Disable code object version 3 for HIP toolchainYaxun Liu2018-10-161-1/+1
| | | | | | | | | AMDGPU backend will switch to code object version 3 by default. Since HIP runtime is not ready, disable it until the runtime is ready. Differential Revision: https://reviews.llvm.org/D53325 llvm-svn: 344630
* [SystemZ] Actually enable -mzvector keywordsUlrich Weigand2018-10-161-0/+1
| | | | | | | | | | | | | | It appears when initially committing the support for the IBM Z vector extension language, one critical line was lost, causing the specific keywords __vector, __bool, and vec_step to not actually be enabled. (Note that this does not affect "vector" and "bool"!) Unfortunately, this was not caught by any tests either. (All existing Z vector tests just use the regular "vector" and "bool" keywords ...) Fixed by adding the missing line and updating the tests. llvm-svn: 344611
* [driver][mips] Support MIPS R6 target triplesSimon Atanasyan2018-10-163-32/+76
| | | | | | | | | | | | | | | | This change adds support for the following MIPS target triples: mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu mipsisa64r6-linux-gnuabi64 mipsisa64r6el-linux-gnuabi64 mipsisa64r6-linux-gnuabin32 mipsisa64r6el-linux-gnuabin32 Patch by Yun Qiang Su. Differential revision: https://reviews.llvm.org/D50850 llvm-svn: 344608
* [driver][mips] Adjust target triple's environment accordingly to provided ↵Simon Atanasyan2018-10-161-6/+19
| | | | | | | | | | | ABI name For MIPS we need to adjust not only architecture name accordingly to ABI provided by the `-mabi` command line option, but also modify triple's environment. For example, for `mips-linux-gnu` triple and `-mabi=n32` option a correct final triple is `mips64-linux-gnuabin32`. llvm-svn: 344603
* [ARM][AArch64] Pass through endian flags to assembler and linker.Peter Smith2018-10-164-7/+37
| | | | | | | | | | | | | | | | | The big-endian arm32 Linux builds are currently failing when the -mbig-endian flag is used but the binutils default on the system is little endian. This also holds when -mlittle-endian is used and the binutils default is big endian. The patch always passes through -EL or -BE to the assembler and linker, taking into account the target and the -mbig-endian and -mlittle-endian flag. Fixes pr38770 Differential Revision: https://reviews.llvm.org/D52784 llvm-svn: 344597
* [OPENMP][NVPTX]Increment iterator only when it is used, NFC.Alexey Bataev2018-10-161-1/+2
| | | | llvm-svn: 344574
* [mips] Fix handling of GNUABIN32 environment in a target tripleSimon Atanasyan2018-10-154-13/+44
| | | | | | | | | | | | The `GNUABIN32` environment in a target triple implies using the N32 ABI. This patch adds support for this environment and switches on N32 ABI if necessary. Patch by Patch by YunQiang Su. Differential revision: https://reviews.llvm.org/D51464 llvm-svn: 344570
* [Driver] Support direct split DWARF emission for FuchsiaPetr Hosek2018-10-151-4/+6
| | | | | | | | | This enables the driver support for direct split DWARF emission for Fuchsia in addition to Linux. Differential Revision: https://reviews.llvm.org/D53248 llvm-svn: 344556
* [analyzer] Teach CallEvent about C++17 aligned operator new().Artem Dergachev2018-10-151-0/+4
| | | | | | | | | | | | | | | | | | | | In C++17, when class C has large alignment value, a special case of overload resolution rule kicks in for expression new C that causes the aligned version of operator new() to be called. The aligned new has two arguments: size and alignment. However, the new-expression has only one "argument": the construct-expression for C(). This causes a false positive in core.CallAndMessage's check for matching number of arguments and number of parameters. Update CXXAllocatorCall, which is a CallEvent sub-class for operator new calls within new-expressions, so that the number of arguments always matched the number of parameters. rdar://problem/44738501 Differential Revision: https://reviews.llvm.org/D52957 llvm-svn: 344539
* [analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point ↵Artem Dergachev2018-10-151-15/+2
| | | | | | | | | | | | | | | | tags. We don't need a separate node for every symbol, because whenever the first symbol leaks, a bug is emitted, the analysis is sinked, and the checker callback immediately returns due to State variable turning into null, so we never get to see the second leaking symbol. Additionally, we are no longer able to break normal analysis while experimenting with debug dumps. Differential Revision: https://reviews.llvm.org/D52804 llvm-svn: 344538
* Revert 344389 "Revert r344375 "[Driver] check for exit code from SIGPIPE""Nick Desaulniers2018-10-151-7/+18
| | | | | | | | | | | | | | | | | Summary: Add preprocessor guards for UNIX. This reverts commit r344389. Reviewers: rnk, majnemer, jfb Reviewed By: rnk Subscribers: cfe-commits, pirama, srhines Differential Revision: https://reviews.llvm.org/D53210 llvm-svn: 344536
* [Fixed Point Arithmetic] FixedPointCastLeonard Chan2018-10-1512-3/+176
| | | | | | | | | | | | | This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split them up. This contains the code for casting between fixed point types and other fixed point types. The method for converting between fixed point types is based off the convert() method in APFixedPoint. Differential Revision: https://reviews.llvm.org/D50616 llvm-svn: 344530
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-16/+0
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeComplete] Make sure keyword 'template' is added even when code pattern ↵Eric Liu2018-10-151-0/+4
| | | | | | | | | | | | is disabled. Reviewers: sammccall, hokein Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53284 llvm-svn: 344509
* [TI removal] Make `getTerminator()` return a generic `Instruction`.Chandler Carruth2018-10-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This removes the primary remaining API producing `TerminatorInst` which will reduce the rate at which code is introduced trying to use it and generally make it much easier to remove the remaining APIs across the codebase. Also clean up some of the stragglers that the previous mechanical update of variables missed. Users of LLVM and out-of-tree code generally will need to update any explicit variable types to handle this. Replacing `TerminatorInst` with `Instruction` (or `auto`) almost always works. Most of these edits were made in prior commits using the perl one-liner: ``` perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g' ``` This also my break some rare use cases where people overload for both `Instruction` and `TerminatorInst`, but these should be easily fixed by removing the `TerminatorInst` overload. llvm-svn: 344504
* Move some helpers from the global namespace into anonymous ones.Benjamin Kramer2018-10-133-1/+7
| | | | llvm-svn: 344468
* [analyzer] Improved cmake configuration for Z3Enrico Steffinlongo2018-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html). Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON. Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7 Reviewers: NoQ, george.karpenkov, mikhail.ramalho Reviewed By: george.karpenkov Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus Tags: #clang Differential Revision: https://reviews.llvm.org/D50818 llvm-svn: 344464
* [analyzer] Small SMT API improvementEnrico Steffinlongo2018-10-131-1/+1
| | | | | | | | | | | | | | Summary: Removed const qualifier from reset method of SMTSolver and Z3Solver objects. Reviewers: mikhail.ramalho, george.karpenkov, NoQ, ddcc Reviewed By: NoQ Subscribers: xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D52031 llvm-svn: 344463
* Re-commit r344234 "clang-cl: Add /showFilenames option (PR31957)"Hans Wennborg2018-10-132-0/+13
| | | | | | | | The test was failing on e.g. PPC which can't target Windows. Fix by requiring X86 target in the test. Also, make sure the output goes to a temporary directory, since CWD may not be writable. llvm-svn: 344462
* [OPENMP][NVPTX]Reduce memory usage in target region.Alexey Bataev2018-10-122-12/+20
| | | | | | | Additional reduction of the global memory usage in the target regions without parallel regions. llvm-svn: 344413
* [MinGW] Allow using LTO when lld is used as linkerMartin Storsjo2018-10-122-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D53195 llvm-svn: 344412
* [clang-format] Fix BraceWrapping AfterFunction for ObjC methodsBen Hamilton2018-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: > clang-format --version > clang-format version 7.0.0 (tags/RELEASE_700/final) > echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}' ``` @implementation Foo - (void)foo:(id)bar { } @end ``` with patch: > bin/clang-format --version > clang-format version 8.0.0 (trunk 344285) > echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |bin/clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}' ``` @implementation Foo - (void)foo:(id)bar { } @end ``` Contributed by hultman@. Reviewers: benhamilton, jolesiak, klimek, Wizard Reviewed By: benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53197 llvm-svn: 344406
* Consistently make llvm::opt::ArgStringList usage explicit to try and appease ↵Simon Pilgrim2018-10-122-7/+7
| | | | | | MSVC 2015 buildbots. NFCI. llvm-svn: 344398
* Revert r344375 "[Driver] check for exit code from SIGPIPE"Reid Kleckner2018-10-121-16/+7
| | | | | | This doesn't build on Windows. llvm-svn: 344389
* [Driver] check for exit code from SIGPIPENick Desaulniers2018-10-121-7/+16
| | | | | | | | | | | | | | | | | | | | Summary: D53000 adds a special exit code for SIGPIPE (writing to a closed reader), and rather than print a fatal warning, skips printing the error. This can be seen commonly from piping into head, tee, or split. Fixes PR25349, rdar://problem/14285346, b/77310947. Reviewers: jfb Reviewed By: jfb Subscribers: cfe-commits, thakis, srhines Differential Revision: https://reviews.llvm.org/D53001 llvm-svn: 344375
* [CodeGen] Handle extern references to OBJC_CLASS_$_*Erik Pilkington2018-10-121-6/+12
| | | | | | | | | | | | | | | | | | | | | | Some ObjC users declare a extern variable named OBJC_CLASS_$_Foo, then use it's address as a Class. I.e., one could define isInstanceOfF: BOOL isInstanceOfF(id c) { extern void OBJC_CLASS_$_F; return [c class] == (Class)&OBJC_CLASS_$_F; } This leads to asserts in clang CodeGen if there is an @implementation of F in the same TU as an instance of this pattern, because CodeGen assumes that a variable named OBJC_CLASS_$_* has the right type. This commit fixes the problem by RAUWing the old (incorrectly typed) global with a new global, then removing the old global. rdar://45077269 Differential revision: https://reviews.llvm.org/D53154 llvm-svn: 344373
* [Driver] Add defaults for Android ARM FPUs.Dan Albert2018-10-121-0/+7
| | | | | | | | | | | | | | | | | Summary: Android mandates that devices have at least vfpv3-d16 until Marshmallow and NEON after that. Still honor the user's decision, but raise the defaults for Android targets. Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53121 llvm-svn: 344367
* [OPENMP][NVPTX]Reduce memory usage in orphaned functions.Alexey Bataev2018-10-122-9/+74
| | | | | | | | | | | | if the function has globalized variables and called in context of target/teams/distribute regions, it does not need to globalize 32 copies of the same variables for memory coalescing, it is enough to have just one copy, because there is parallel region. Patch does this by adding call for `__kmpc_parallel_level` function and checking its return value. If the code sees that the parallel level is 0, then only one variable is allocated, not 32. llvm-svn: 344356
* Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.Simon Pilgrim2018-10-121-1/+1
| | | | llvm-svn: 344352
* Remove top-level using declaration from header files, as these aliases leak.Sam McCall2018-10-122-3/+1
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53135 llvm-svn: 344337
* [Tooling] Expose ExecutorName option.Eric Liu2018-10-121-1/+1
| | | | llvm-svn: 344335
* [analyzer] Fix a bug in unexplored_first_location_queue iteration order.George Karpenkov2018-10-121-2/+2
| | | | | | Pointed out by Artem in post-commit review for https://reviews.llvm.org/D53058 llvm-svn: 344322
* [analyzer] Experiment with an iteration order only based on location, and ↵George Karpenkov2018-10-113-2/+67
| | | | | | | | not using the stack frame Differential Revision: https://reviews.llvm.org/D53058 llvm-svn: 344313
* [analyzer] Avoid unneeded invalidation in RetainCountCheckerGeorge Karpenkov2018-10-111-19/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D53168 llvm-svn: 344312
* [analyzer] Retain count checker for OSObject: recognize OSDynamicCastGeorge Karpenkov2018-10-111-1/+12
| | | | | | | | | | | For now, tresting the cast as a no-op, and disregarding the case where the output becomes null due to the type mismatch. rdar://45174557 Differential Revision: https://reviews.llvm.org/D53156 llvm-svn: 344311
* Revert "[Driver] Default Android toolchains to libc++."Dan Albert2018-10-112-7/+0
| | | | | | | | | Breaks some of the Android bots because they aren't expecting to need to explicitly set -stdlib. This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8. llvm-svn: 344297
* [Driver] Default Android toolchains to libc++.Dan Albert2018-10-112-0/+7
| | | | | | | | | | | | Reviewers: srhines, pirama, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53109 llvm-svn: 344296
OpenPOWER on IntegriCloud