summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Make LLVM_APPEND_VC_REV=OFF affect clang, lld, and lldb as well.Nico Weber2020-06-231-2/+2
| | | | | | | | | | | | | | | | | | When LLVM_APPEND_VC_REV=OFF is set, the current git hash is no longer embedded into binaries (mostly for --version output). Without it, most binaries need to relink after every single commit, even if they didn't change otherwise (due to, say, a documentation-only commit). LLVM_APPEND_VC_REV is ON by default, so this doesn't change the default behavior of anything. With this, all clients of GenerateVersionFromVCS.cmake honor LLVM_APPEND_VC_REV. Differential Revision: https://reviews.llvm.org/D72855 (cherry picked from commit fb5fafb23cc2d8613f8be2487afe94d8594a88ce)
* [PowerPC] Treat 'Z' inline asm constraint as a true memory constraintNemanja Ivanovic2020-06-221-1/+2
| | | | | | | | | | | | We currently emit incorrect codegen for this constraint because we set it as a constraint that allows registers. This will cause the value to be copied to the stack and that address to be passed as the address. This is not what we want. Fixes: https://bugs.llvm.org/show_bug.cgi?id=42762 Differential revision: https://reviews.llvm.org/D77542 (cherry picked from commit aede24ecaa08db806fb173faf2de9cff95df8cee)
* [CUDA] Assume the latest known CUDA version if we've found an unknown one.Artem Belevich2020-01-291-3/+5
| | | | | | | | | | | | | | | | | This makes clang somewhat forward-compatible with new CUDA releases without having to patch it for every minor release without adding any new function. If an unknown version is found, clang issues a warning (can be disabled with -Wno-cuda-unknown-version) and assumes that it has detected the latest known version. CUDA releases are usually supersets of older ones feature-wise, so it should be sufficient to keep released clang versions working with minor CUDA updates without having to upgrade clang, too. Differential Revision: https://reviews.llvm.org/D73231 (cherry picked from commit 12fefeef203ab4ef52d19bcdbd4180608a4deae1)
* [Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2aSaar Raz2020-01-241-1/+1
| | | | | | | | | Now with concepts support merged and mostly complete, we do not need -fconcepts-ts (which was also misleading as we were not implementing the TS) and can enable concepts features under C++2a. A warning will be generated if users still attempt to use -fconcepts-ts. (cherry picked from commit 67c608a9695496cfc9d3fdf9d0b12b554ac6b4df)
* Revert "[RISCV] Add Clang frontend support for Bitmanip extension"Scott Egerton2020-01-152-9/+1
| | | | This reverts commit 57cf6ee9c84434161088c39a6f8dd2aae14eb12d.
* [RISCV] Add Clang frontend support for Bitmanip extensionScott Egerton2020-01-142-1/+9
| | | | | | | | | | | | | | Summary: This adds the __riscv_bitmanip macro and the 'b' target feature to enable it. Reviewers: asb, simoncook, lewis-revill, PaoloS, lenary Reviewed By: lenary Subscribers: Jim, rbar, johnrusso, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71553
* [Driver][PowerPC] Move powerpcspe logic from cc1 to DriverFangrui Song2020-01-101-2/+1
| | | | | | | | | Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433
* [clang] Fix out-of-bounds memory access in ComputeLineNumbersJan Korous2020-01-101-13/+8
| | | | Differential Revision: https://reviews.llvm.org/D72409
* [PowerPC]: Add powerpcspe target triple subarch componentJustin Hibbits2020-01-082-3/+3
| | | | | | | | | | Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014
* [PowerPC][Triple] Use elfv2 on freebsd>=13 and linux-muslFangrui Song2020-01-071-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Every powerpc64le platform uses elfv2. For powerpc64, the environments "elfv1" and "elfv2" were added for FreeBSD ELFv1->ELFv2 migration in D61950. FreeBSD developers have decided to use OS versions to select ABI, and no one is relying on the environments. Also use elfv2 on powerpc64-linux-musl. Users can always use -mabi=elfv1 and -mabi=elfv2 to override the default ABI. Reviewed By: adalava Differential Revision: https://reviews.llvm.org/D72352
* [OpenMP][NFCI] Use the libFrontend ProcBindKind in ClangJohannes Doerfert2019-12-261-10/+8
| | | | | | | | | | | | This removes the OpenMPProcBindClauseKind enum in favor of llvm::omp::ProcBindKind which lives in OpenMPConstants.h and was introduced in D70109. No change in behavior is expected. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D70289
* [OPENMP50]Basic support for conditional lastprivate.Alexey Bataev2019-12-241-2/+15
| | | | Added parsing/sema checks for conditional lastprivates.
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-232-14/+20
| | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch moves some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Differential Revision: https://reviews.llvm.org/D68627
* [NFC] Move OptionUtils from Basic to DriverYaxun (Sam) Liu2019-12-232-49/+0
| | | | Differential Revision: https://reviews.llvm.org/D71802
* reland "[DebugInfo] Support to emit debugInfo for extern variables"Yonghong Song2019-12-221-0/+2
| | | | | | | | | | | | | Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo for extern variables for BPF target. The commit is reverted by 891e25b02d760d0de18c7d46947913b3166047e7 as the committed tests using %clang instead of %clang_cc1 causing test failed in certain scenarios as reported by Reid Kleckner. This patch fixed the tests by using %clang_cc1. Differential Revision: https://reviews.llvm.org/D71818
* Revert "[DebugInfo] Support to emit debugInfo for extern variables"Reid Kleckner2019-12-221-2/+0
| | | | | | | This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825. The tests committed along with this change do not pass, and should be changed to use %clang_cc1.
* [NFC] Separate getLastArgIntValue to BasicYaxun (Sam) Liu2019-12-212-0/+49
| | | | | | | | getLastArgIntValue is a useful utility function to get command line argument as an integer. Currently it is in Frontend so that it can only be used by clang -cc1. Move it to basic so that it can also be used by clang driver. Differential Revision: https://reviews.llvm.org/D71080
* [clang] Fix the canonicalization of paths in -fdiagnostics-absolute-pathsKarl-Johan Karlsson2019-12-201-5/+20
| | | | | | | | | | | | | | | | In the current implementation of clang the canonicalization of paths in diagnostic messages (when using -fdiagnostics-absolute-paths) only works if the symbolic link is in the directory part of the filename, not if the file itself is a symbolic link to another file. This patch adds support to canonicalize the complete path including the file. Reviewers: rsmith, hans, rnk, ikudrin Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D70527
* Add support for the MS qualifiers __ptr32, __ptr64, __sptr, __uptr.Amy Huang2019-12-185-4/+49
| | | | | | | | | | | | | | | | | | | | Summary: This adds parsing of the qualifiers __ptr32, __ptr64, __sptr, and __uptr and lowers them to the corresponding address space pointer for 32-bit and 64-bit pointers. (32/64-bit pointers added in https://reviews.llvm.org/D69639) A large part of this patch is making these pointers ignore the address space when doing things like overloading and casting. https://bugs.llvm.org/show_bug.cgi?id=42359 Reviewers: rnk, rsmith Subscribers: jholewinski, jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71039
* [OPENMP50]Add parsing/sema analysis for nontemporal clause.Alexey Bataev2019-12-171-0/+5
| | | | | Add basic support for parsing/sema analysis of the nontemporal clause in simd-based directives.
* [Sema] Improve diagnostic about addr spaces for overload candidatesAnastasia Stulova2019-12-131-0/+1
| | | | | | | | | | Allow sending address spaces into diagnostics to simplify and improve error reporting. Improved wording of diagnostics for address spaces in overloading. Tags: #clang Differential Revision: https://reviews.llvm.org/D71111
* [PS4] Predefine the __SCE__ macro for the x86_64-scei-ps4 tripleWarren Ristow2019-12-121-0/+1
|
* [OPENMP50]Add if clause in teams distribute simd directive.Alexey Bataev2019-12-111-0/+2
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [DebugInfo] Support to emit debugInfo for extern variablesYonghong Song2019-12-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extern variable usage in BPF is different from traditional pure user space application. Recent discussion in linux bpf mailing list has two use cases where debug info types are required to use extern variables: - extern types are required to have a suitable interface in libbpf (bpf loader) to provide kernel config parameters to bpf programs. https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t - extern types are required so kernel bpf verifier can verify program which uses external functions more precisely. This will make later link with actual external function no need to reverify. https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed This patch added clang support to emit debuginfo for extern variables with a TargetInfo hook to enable it. The debuginfo for the extern variable is emitted only if that extern variable is referenced in the current compilation unit. Currently, only BPF target enables to generate debug info for extern variables. The emission of such debuginfo is disabled for C++ at this moment since BPF only supports a subset of C language. Emission with C++ can be enabled later if an appropriate use case is identified. -fstandalone-debug permits us to see more debuginfo with the cost of bloated binary size. This patch did not add emission of extern variable debug info with -fstandalone-debug. This can be re-evaluated if there is a real need. Differential Revision: https://reviews.llvm.org/D70696
* [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.hJohannes Doerfert2019-12-101-26/+2
| | | | | | | | | | | | | | | | | | | Summary: The new OpenMPConstants.h is a location for all OpenMP related constants (and helpers) to live. This patch moves the directives there (the enum OpenMPDirectiveKind) and rewires Clang to use the new location. Initially part of D69785. Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: jholewinski, ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69853
* Revert "[Sema][X86] Consider target attribute into the checks in ↵Reid Kleckner2019-12-062-20/+14
| | | | | | | | | validateOutputSize and validateInputSize." This reverts commit e1578fd2b79fe5af5f80c0c166a8abd0f816c022. It introduces a dependency on Attr.h which I am removing from ASTContext.h.
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-062-14/+20
| | | | | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch copies some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Probably need some refactoring here to share more code with Codegen. Is there a good place to do that? Also need to support the cpu_specific attribute as well. Differential Revision: https://reviews.llvm.org/D68627
* [OPENMP50]Add if clause in distribute simd directive.Alexey Bataev2019-12-061-0/+2
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [OpenMP50] Add parallel master constructcchen2019-12-051-0/+12
| | | | | | | | | | | | Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: rnk, jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem Tags: #clang Differential Revision: https://reviews.llvm.org/D70726
* Revert "[OpenMP50] Add parallel master construct, by Chi Chun Chen."Reid Kleckner2019-12-041-12/+0
| | | | | | This reverts commit 713dab21e27c987b9114547ce7136bac2e775de9. Tests do not pass on Windows.
* Bug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest modeSoumi Manna2019-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch adds correct value of _MSVC_LANG to match with MSVC++ VS2019 /std:c++latest mode. Bugzilla - Bug 43965 https://bugs.llvm.org/show_bug.cgi?id=43965 The value for a MS specific macro differs from Microsoft starting with VS2019 in /std:c++latest mode. -bash-4.2$ cat msvclang.cpp _MSVC_LANG -bash-4.2$ cl /std:c++latest -E msvclang.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. /std:c++latest is provided as a preview of language features from the latest C++ working draft, and we're eager to hear about bugs and suggestions for improvements. However, note that these features are provided as-is without support, and subject to changes or removal as the working draft evolves. See https://go.microsoft.com/fwlink/?linkid=2045807 for details. msvclang.cpp 201705L -bash-4.2$ clang-cl /std:c++latest -E msvclang.cpp 201704L Reviewers: rnk Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D70996
* [OpenMP50] Add parallel master construct, by Chi Chun Chen.cchen2019-12-041-0/+12
| | | | | | | | | | | | Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem Tags: #clang Differential Revision: https://reviews.llvm.org/D70726
* [Clang] Define Fuchsia C++ABIPetr Hosek2019-12-031-0/+1
| | | | | | | Currently, it is a modified version of the Itanium ABI, with the only change being that constructors and destructors return 'this'. Differential Revision: https://reviews.llvm.org/D70575
* [ARM][AArch64] Complex addition Neon intrinsics for Armv8.3-AVictor Campos2019-12-023-1/+15
| | | | | | | | | | | | | | | | | | | Summary: Add support for vcadd_* family of intrinsics. This set of intrinsics is available in Armv8.3-A. The fp16 versions require the FP16 extension, which has been available (opt-in) since Armv8.2-A. Reviewers: t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70862
* Revert "[ARM] Allocatable Global Register Variables for ARM"Carey Williams2019-11-292-35/+0
| | | | This reverts commit 2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77.
* [mips] Check that features required by built-ins are enabledSimon Atanasyan2019-11-291-0/+3
| | | | | | | | | | | | Now Clang does not check that features required by built-in functions are enabled. That causes errors in the backend reported in PR44018. This patch fixes this bug by checking that required features are enabled. This should fix PR44018. Differential Revision: https://reviews.llvm.org/D70808
* [Clang] Enable RISC-V support for FuchsiaPetr Hosek2019-11-211-0/+2
| | | | | | | | We don't have a full sysroot yet, so for now we only include compiler support and compiler-rt builtins, the rest of the runtimes will get enabled later. Differential Revision: https://reviews.llvm.org/D70477
* [PowerPC] Add new Future CPU for PowerPCStefan Pintilie2019-11-212-3/+27
| | | | | | | | | | | This patch will add -mcpu=future into clang for PowerPC. A CPU type is required for work that may possibly be enabled for some future Power CPU. The CPU type future will serve that purpose. This patch introduces no new functionality. It is an incremental patch on top of which Power PC work for some future CPU can be done. Differential Revision: https://reviews.llvm.org/D70262
* [OPENMP50]Add if clause in for simd directive.Alexey Bataev2019-11-211-0/+2
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists existIlya Biryukov2019-11-212-5/+8
| | | | | | | With updates to various LLVM tools that use SpecialCastList. It was tempting to use RealFileSystem as the default, but that makes it too easy to accidentally forget passing VFS in clang code.
* Revert "[Driver] Use VFS to check if sanitizer blacklists exist"Ilya Biryukov2019-11-212-8/+5
| | | | | This reverts commit ba6f906854263375cff3257d22d241a8a259cf77. Commit caused compilation errors on llvm tests. Will fix and re-land.
* [Driver] Use VFS to check if sanitizer blacklists existIlya Biryukov2019-11-212-5/+8
| | | | | | | | | | | | | | | | | | | Summary: This is a follow-up to 590f279c456bbde632eca8ef89a85c478f15a249, which moved some of the callers to use VFS. It turned out more code in Driver calls into real filesystem APIs and also needs an update. Reviewers: gribozavr2, kadircet Reviewed By: kadircet Subscribers: ormris, mgorny, hiraditya, llvm-commits, jkorous, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70440
* [OPENMP50]Add if clause in simd directive.Alexey Bataev2019-11-191-1/+4
| | | | | | According to OpenMP 5.0, if clause can be used in simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [ARM] Allocatable Global Register Variables for ARMAnna Welker2019-11-182-0/+35
| | | | | | | | | | | | Provides support for using r6-r11 as globally scoped register variables. This requires a -ffixed-rN flag in order to reserve rN against general allocation. If for a given GRV declaration the corresponding flag is not found, or the the register in question is the target's FP, we fail with a diagnostic. Differential Revision: https://reviews.llvm.org/D68862
* Implement target(branch-protection) attribute for AArch64Momchil Velikov2019-11-152-0/+27
| | | | | | | | | This patch implements `__attribute__((target("branch-protection=...")))` in a manner, compatible with the analogous GCC feature: https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes Differential Revision: https://reviews.llvm.org/D68711
* Add 8548 CPU definition and attributesJustin Hibbits2019-11-122-11/+20
| | | | | | | | 8548 CPU is GCC's name for the e500v2, so accept this in clang. The e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well, as GCC does. Differential Revision: https://reviews.llvm.org/D67787
* AArch64: add arm64_32 support to Clang.Tim Northover2019-11-123-7/+38
|
* clang/Modules: Delay err_module_file_conflict if a diagnostic is in flightDuncan P. N. Exon Smith2019-11-111-2/+3
| | | | | | | As part of an audit of whether all errors are being reported from the ASTReader, delay err_module_file_conflict if a diagnostic is already in flight when it is hit. This required plumbing an extra argument through the delayed diagnostic mechanics in DiagnosticsEngine.
* [OPENMP50]Generalize handling of context matching/scoring.Alexey Bataev2019-11-111-0/+43
| | | | | | | | | | | | | | Summary: Untie context matching/scoring from the attribute for declare variant directive to simplify future uses in other context-dependent directives. Reviewers: jdoerfert Subscribers: guansong, kkwli0, caomhin, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69952
* Basic: fix FileManager invalidation issue for file redirectAlex Suhan2019-11-081-7/+11
| | | | | Insertion into SeenFileEntries can invalidate iterators, we need to do another lookup on the re-intern path.
OpenPOWER on IntegriCloud