summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* libclang depends on ClangDriverOptions since r352803Nico Weber2019-09-061-1/+4
| | | | | | | | | | | | | | | | | | | | | Without this, the build would sometimes fail with In file included from clang/tools/libclang/CIndexer.cpp:17: In file included from clang/include/clang/Driver/Driver.h:15: clang/include/clang/Driver/Options.h:44:10: fatal error: 'clang/Driver/Options.inc' file not found #include "clang/Driver/Options.inc" ^~~~~~~~~~~~~~~~~ if Options.inc wasn't generated before libclang was built by coincidence. (In the GN build, this works because lib/Driver there declares the dep on tablegen as a public_dep since the generated file is part of Driver's public interface, and then things work out automatically without every client of Driver having to be careful.) llvm-svn: 371205
* Reland [LifetimeAnalysis] Support more STL idioms (template forward ↵Matthias Gehre2019-09-068-15/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration and DependentNameType) Reland after https://reviews.llvm.org/D66806 fixed the false-positive diagnostics. Summary: This fixes inference of gsl::Pointer on std::set::iterator with libstdc++ (the typedef for iterator on the template is a DependentNameType - we can only put the gsl::Pointer attribute on the underlaying record after instantiation) inference of gsl::Pointer on std::vector::iterator with libc++ (the class was forward-declared, we added the gsl::Pointer on the canonical decl (the forward decl), and later when the template was instantiated, there was no attribute on the definition so it was not instantiated). and a duplicate gsl::Pointer on some class with libstdc++ (we first added an attribute to a incomplete instantiation, and then another was copied from the template definition when the instantiation was completed). We now add the attributes to all redeclarations to fix thos issues and make their usage easier. Reviewers: gribozavr Subscribers: Szelethus, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66179 llvm-svn: 371182
* [X86] Prevent passing vectors of __int128 as <X x i128> in llvm IRCraig Topper2019-09-065-6/+58
| | | | | | | | | | | | | As far as I can tell, gcc passes 256/512 bit vectors __int128 in memory. And passes a vector of 1 _int128 in an xmm register. The backend considers <X x i128> as an illegal type and will scalarize any arguments with that type. So we need to coerce the argument types in the frontend to match to avoid the illegal type. I'm restricting this to change to Linux and NetBSD based on the how similar ABI changes have been handled in the past. PS4, FreeBSD, and Darwin are unaffected. I've also added a new -fclang-abi-compat version to restore the old behavior. This issue was identified in PR42607. Though even with the types changed, we still seem to be doing some unnecessary stack realignment. llvm-svn: 371169
* [X86] Pre-commit vector of __int128 test cases for D64672.Craig Topper2019-09-061-0/+49
| | | | llvm-svn: 371168
* Implement Microsoft-compatible mangling for decomposition declarations.Nico Weber2019-09-053-14/+30
| | | | | | | | | | | | | | | Match cl.exe's mangling for decomposition declarations. Decomposition declarations are considered to be anonymous structs, and use the same convention as for anonymous struct/union declarations. Naming confirmed to match https://godbolt.org/z/K2osJa Patch from Eric Astor <epastor@google.com>! Differential Revision: https://reviews.llvm.org/D67202 llvm-svn: 371124
* [Diagnostics] Minor improvements for -Wxor-used-as-powDavid Bolvansky2019-09-053-40/+88
| | | | | | Extracted from D66397; implemented suggestion for 2^64; tests revisited. llvm-svn: 371122
* [clang][Index] Replace CodegenNameGenerator with ASTNameGeneratorJan Korous2019-09-055-100/+11
| | | | | | | | Follow-up to: 3ff8c3b73f6, d5d15b4c1fd Should be NFC since the original patch just moved the code. llvm-svn: 371117
* Revert: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and ↵Alexandre Ganea2019-09-057-75/+20
| | | | | | mark them as artificial llvm-svn: 371113
* [AST][NFC] Doc comments for ASTNameGeneratorJan Korous2019-09-051-0/+8
| | | | llvm-svn: 371112
* [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them ↵Alexandre Ganea2019-09-057-20/+75
| | | | | | | | as artificial Differential Revision: https://reviews.llvm.org/D66328 llvm-svn: 371080
* [ARM] Add support for the s,j,x,N,O inline asm constraintsDavid Candler2019-09-052-5/+393
| | | | | | | | | | | | | | | | | | | | | | A number of inline assembly constraints are currently supported by LLVM, but rejected as invalid by Clang: Target independent constraints: s: An integer constant, but allowing only relocatable values ARM specific constraints: j: An immediate integer between 0 and 65535 (valid for MOVW) x: A 32, 64, or 128-bit floating-point/SIMD register: s0-s15, d0-d7, or q0-q3 N: An immediate integer between 0 and 31 (Thumb1 only) O: An immediate integer which is a multiple of 4 between -508 and 508. (Thumb1 only) This patch adds support to Clang for the missing constraints along with some checks to ensure that the constraints are used with the correct target and Thumb mode, and that immediates are within valid ranges (at least where possible). The constraints are already implemented in LLVM, but just a couple of minor corrections to checks (V8M Baseline includes MOVW so should work with 'j', 'N' and 'O' shouldn't be valid in Thumb2) so that Clang and LLVM are in line with each other and the documentation. Differential Revision: https://reviews.llvm.org/D65863 Change-Id: I18076619e319bac35fbb60f590c069145c9d9a0a llvm-svn: 371079
* Add -m(no)-spe to clangJustin Hibbits2019-09-056-2/+22
| | | | | | | | | | | | | | Summary: r337347 added support for the Signal Processing Engine (SPE) to LLVM. This follows that up with the clang side. This adds -mspe and -mno-spe, to match GCC. Subscribers: nemanjai, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49754 llvm-svn: 371066
* [OpenCL] Add image type handling for builtinsSven van Haastregt2019-09-053-46/+248
| | | | | | | | | | | | | | | | | | | Image types were previously available, but not working. This patch adds image type handling. Rename the image type definitions in the .td file to make them consistent with other type names. Use abstract types to represent the unqualified types. Instantiate access-qualified image types at the point of use using, e.g. `ImageType<Image2d, "RO">`. Add/update TableGen definitions for the read_image/write_image builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63480 llvm-svn: 371046
* [libclang] Refactored SharedParsedRegionsStorageDmitri Gribenko2019-09-051-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Removed the `PPRegionSetTy` typedef because it is only used 3 times, and obscures code more than it helps. Renamed SharedParsedRegionsStorage to ThreadSafeParsedRegions, because that better reflects the reason for this type to exist. Replaced the `copyTo()` method that had an out parameter with a getter. Renamed the `merge()` method to `addParsedRegions()`. Renamed `ParsedSrcLocationsTracker::ParsedRegions` to `ParsedRegionsSnapshot`, which better reflects its role. Subscribers: arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67077 llvm-svn: 371041
* [Sema] Refactor LookupVisibleDecls. NFCIlya Biryukov2019-09-051-272/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We accumulated some configuration parameters for LookupVisibleDecls that are being passed unchanged to recursive calls, e.g. LoadExternal and IncludeDependentBases. At the same time, there is a bunch of parameters that can change in the recursive invocations. It is hard to tell the difference between those groups, making the code hard to follow. This change introduces a helper struct and factors out the non-changing bits into fields, making recursive calls in the implementation code easier to read. Reviewers: sammccall Reviewed By: sammccall Subscribers: riccibruno, doug.gregor, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65752 llvm-svn: 371032
* Revert r361885 "[Driver] Fix -working-directory issues"Hans Wennborg2019-09-055-44/+35
| | | | | | | | | | | | | | | | | | | | | | | This made clang unable to open files using relative paths on network shares on Windows (PR43204). On the bug it was pointed out that createPhysicalFileSystem() is not terribly mature, and using it is risky. Reverting for now until there's a clear way forward. > Currently the `-working-directory` option does not actually impact the working > directory for all of the clang driver, it only impacts how files are looked up > to make sure they exist. This means that that clang passes the wrong paths > to -fdebug-compilation-dir and -coverage-notes-file. > > This patch fixes that by changing all the places in the driver where we convert > to absolute paths to use the VFS, and then calling setCurrentWorkingDirectory on > the VFS. This also changes the default VFS for `Driver` to use a virtualized > working directory, instead of changing the process's working directory. > > Differential Revision: https://reviews.llvm.org/D62271 This also revertes the part of r369938 which checked that -working-directory works. llvm-svn: 371027
* Rename of constants in ASTImporterVisibilityTest. NFC.Balazs Keri2019-09-051-47/+55
| | | | | | | | | | | | | | Reviewers: martong, a.sidorin, shafik Reviewed By: shafik Subscribers: shafik, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67174 llvm-svn: 371021
* AMDGPU: Add builtins for is_shared/is_privateMatt Arsenault2019-09-055-13/+53
| | | | llvm-svn: 371010
* [c++20] Fix some ambiguities in our mangling of lambdas with explicitRichard Smith2019-09-056-49/+200
| | | | | | | | | | | | | template parameters. This finishes the implementation of the proposal described in https://github.com/itanium-cxx-abi/cxx-abi/issues/31. (We already implemented the <lambda-sig> extensions, but didn't take them into account when computing mangling numbers, and didn't deal properly with expanded parameter packs, and didn't disambiguate between different levels of template parameters in manglings.) llvm-svn: 371004
* [analyzer] scan-build: handle --sysroot=/path in addition to --sysroot /path.Artem Dergachev2019-09-051-5/+8
| | | | | | | | | | | Current code assumes flags in CompilerLinkerOptionMap don't use =, which isn't always true. Patch by Chris Laplante! Differential Revision: https://reviews.llvm.org/D66569 llvm-svn: 371002
* For PR43213, track whether template parameters are implicit throughRichard Smith2019-09-042-0/+10
| | | | | | | template instantiation so we know whether to mangle them in lambda-expressions. llvm-svn: 370991
* [www] Fix hyperlink syntax in attribute reference.Richard Smith2019-09-041-1/+1
| | | | llvm-svn: 370987
* [www] Update attribute reference for 'constinit'.Richard Smith2019-09-042-3/+11
| | | | llvm-svn: 370986
* Diagnose _Atomic as a C11 extension.Aaron Ballman2019-09-044-65/+86
| | | | llvm-svn: 370982
* [DebugInfo] Emit DW_TAG_enumeration_type for referenced global enumerator.Yuanfang Chen2019-09-042-10/+25
| | | | | | | | | | | | | | | | | This essentially reverts changes from r361400 while keeping behavior for CodeView. Reviewers: akhuang, rnk, probinson Reviewed by: rnk Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67141 llvm-svn: 370981
* [c++20] P1143R2: Add support for the C++20 'constinit' keyword.Richard Smith2019-09-0427-77/+385
| | | | | | | | | | | | | This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a couple of additional syntactic and semantic restrictions. In passing, I added a warning for the attribute form being added after we have already seen the initialization of the variable (but before we see the definition); that case previously slipped between the cracks and the attribute was silently ignored. llvm-svn: 370972
* [NewPM][Sancov] Make Sancov a Module Pass instead of 2 PassesLeonard Chan2019-09-041-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch merges the sancov module and funciton passes into one module pass. The reason for this is because we ran into an out of memory error when attempting to run asan fuzzer on some protobufs (pc.cc files). I traced the OOM error to the destructor of SanitizerCoverage where we only call appendTo[Compiler]Used which calls appendToUsedList. I'm not sure where precisely in appendToUsedList causes the OOM, but I am able to confirm that it's calling this function *repeatedly* that causes the OOM. (I hacked sancov a bit such that I can still create and destroy a new sancov on every function run, but only call appendToUsedList after all functions in the module have finished. This passes, but when I make it such that appendToUsedList is called on every sancov destruction, we hit OOM.) I don't think the OOM is from just adding to the SmallSet and SmallVector inside appendToUsedList since in either case for a given module, they'll have the same max size. I suspect that when the existing llvm.compiler.used global is erased, the memory behind it isn't freed. I could be wrong on this though. This patch works around the OOM issue by just calling appendToUsedList at the end of every module run instead of function run. The same amount of constants still get added to llvm.compiler.used, abd we make the pass usage and logic simpler by not having any inter-pass dependencies. Differential Revision: https://reviews.llvm.org/D66988 llvm-svn: 370971
* Generate parent context id from Decl* instead of DeclContext*.Aaron Ballman2019-09-045-7/+298
| | | | | | | | | | | | | Because of multiple inheritance, a DeclContext pointer does not produce the same pointer representation as a Decl pointer that references the same AST Node. When dumping the parentDeclContextId field of a node, convert the pointer to Decl* first, so the id can be used to find the AST node it references. Patch by Bert Belder. llvm-svn: 370970
* [OpenMP][Docs] Provide implementation status detailsJohannes Doerfert2019-09-041-4/+132
| | | | | | | | | | | | | | | This adds a more fine-grained list of OpenMP features with their implementation status and associated reviews/commits. Reviewers: kkwli0, ABataev, RaviNarayanaswamy, gtbercea, Hahnfeld Subscribers: bollu, guansong, jfb, hfinkel, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64375 llvm-svn: 370930
* Avoid assemble step in verbose-output-quoting.cYuanfang Chen2019-09-041-8/+8
| | | | | | | | | | | | Reviewers: hans Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65527 llvm-svn: 370928
* [X86] Add support for avx512bf16 for __builtin_cpu_supports and ↵Craig Topper2019-09-041-0/+1
| | | | | | compiler-rt's cpu indicator. llvm-svn: 370915
* [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*Jinsong Ji2019-09-043-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is follow up of https://reviews.llvm.org/D66699. We might get ISEL ICE if we call vec_dss with non const 3rd arg. ``` Cannot select: intrinsic %llvm.ppc.altivec.dst ``` We should check the constraints in clang and generate better error messages. Reviewers: nemanjai, hfinkel, echristo, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66748 llvm-svn: 370912
* [Driver] Use shared singleton instance of DriverOptTableIlya Biryukov2019-09-0411-80/+85
| | | | | | | | | | | | | | | | | | | | | Summary: This significantly reduces the time required to run clangd tests, by ~10%. Should also have an effect on other tests that run command-line parsing multiple times inside a single invocation. Reviewers: gribozavr, sammccall Reviewed By: sammccall Subscribers: kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67163 llvm-svn: 370908
* [ASTImporter] Added visibility context check for TypedefNameDecl.Balazs Keri2019-09-042-13/+68
| | | | | | | | | | | | | | | | | | | Summary: ASTImporter makes now difference between typedefs and type aliases with same name in different translation units if these are not visible outside. Reviewers: martong, a.sidorin, shafik, a_sidorin Reviewed By: martong, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64480 llvm-svn: 370903
* [PowerPC][Altivec] Fix constant argument for vec_dssJinsong Ji2019-09-045-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to vec_ct* in https://reviews.llvm.org/rL304205. The argument must be a constant, otherwise instruction selection will fail. always_inline is not enough for isel to always fold everything away at -O0. The fix is to turn the function into macros in altivec.h. Fixes https://bugs.llvm.org/show_bug.cgi?id=43072 Reviewers: nemanjai, hfinkel, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66699 llvm-svn: 370902
* Revert "[Clang Interpreter] Initial patch for the constexpr interpreter"Roman Lebedev2019-09-0466-9058/+386
| | | | | | | | | Breaks BUILD_SHARED_LIBS build, introduces cycles in library dependency graphs. (clangInterp depends on clangAST which depends on clangInterp) This reverts r370839, which is an yet another recommit of D64146. llvm-svn: 370874
* Re-commit r363191 "[MS] Pretend constexpr variable template specializations ↵Hans Wennborg2019-09-042-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | are inline" While the next Visual Studio update (16.3) will fix this issue, that hasn't shipped yet. Until then Clang wouldn't work with MSVC's headers which seems unfortunate. Let's keep this in until VS 16.3 ships. (See also PR42843.) > Fixes link errors with clang and the latest Visual C++ 14.21.27702 > headers, which was reported as PR42027. > > I chose to intentionally make these things linkonce_odr, i.e. > discardable, so that we don't emit definitions of these things in every > translation unit that includes STL headers. > > Note that this is *not* what MSVC does: MSVC has not yet implemented C++ > DR2387, so they emit fully specialized constexpr variable templates with > static / internal linkage. > > Reviewers: rsmith > > Differential Revision: https://reviews.llvm.org/D63175 llvm-svn: 370850
* [Clang Interpreter] Initial patch for the constexpr interpreterNandor Licker2019-09-0466-386/+9058
| | | | | | | | | | | | | | | | | | Summary: This patch introduces the skeleton of the constexpr interpreter, capable of evaluating a simple constexpr functions consisting of if statements. The interpreter is described in more detail in the RFC. Further patches will add more features. Reviewers: Bigcheese, jfb, rsmith Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64146 llvm-svn: 370839
* [libclang][test][NFC] Split off fixture from tests.Jan Korous2019-09-032-71/+95
| | | | llvm-svn: 370825
* [AMDGPU] Set default flat work group size to (1,256) for HIPYaxun Liu2019-09-032-5/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D67048 llvm-svn: 370808
* Unbreak the build after r370798Benjamin Kramer2019-09-031-1/+1
| | | | llvm-svn: 370807
* Disable stack exhaustion test on NetBSD, where either the detection orRichard Smith2019-09-031-0/+5
| | | | | | recovery mechanism does not appear to work. llvm-svn: 370801
* [analyzer] NonNullParamChecker and CStringChecker parameter number in ↵Kristof Umann2019-09-036-34/+45
| | | | | | | | | | | | | | | | | | | | checker message There are some functions which can't be given a null pointer as parameter either because it has a nonnull attribute or it is declared to have undefined behavior (e.g. strcmp()). Sometimes it is hard to determine from the checker message which parameter is null at the invocation, so now this information is included in the message. This commit fixes https://bugs.llvm.org/show_bug.cgi?id=39358 Reviewed By: NoQ, Szelethus, whisperity Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D66333 llvm-svn: 370798
* [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'.Richard Smith2019-09-033-30/+33
| | | | | | Don't turn the boxes green yet, since Clang 9 hasn't been released. llvm-svn: 370795
* [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+Artem Belevich2019-09-031-1/+9
| | | | | | | | | | | vote.ballot instruction is gone in recent CUDA versions and vote.sync.ballot can not be used because it needs a thread mask parameter. Fortunately PTX 6.2 (introduced with CUDA-9.2) provides activemask.b32 instruction for this. Differential Revision: https://reviews.llvm.org/D66665 llvm-svn: 370792
* clang: default to DWARF 4 for FreeBSD 12.0 and laterEd Maste2019-09-033-3/+13
| | | | | | | | | | | | Older FreeBSD versions included GDB 6.1 and had other tools that were unable to handle debug information newer than DWARF 2. Those tools have since been updated. (An old version of GDB is still kept for kernel crash handling, but the kernel is compiled with an explicit -gdwarf2.) Reviewed by: dim Differential Revision: https://reviews.llvm.org/D66760 llvm-svn: 370779
* [LifetimeAnalysis] Fix some false positivesGabor Horvath2019-09-032-5/+163
| | | | | | Differential Revision: https://reviews.llvm.org/D66806 llvm-svn: 370773
* [analyzer] Add a checker option to detect nested dead storesKristof Umann2019-09-037-165/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables the users to specify an optional flag which would warn for more dead stores. Previously it ignored if the dead store happened e.g. in an if condition. if ((X = generate())) { // dead store to X } This patch introduces the `WarnForDeadNestedAssignments` option to the checker, which is `false` by default - so this change would not affect any previous users. I have updated the code, tests and the docs as well. If I missed something, tell me. I also ran the analysis on Clang which generated 14 more reports compared to the unmodified version. All of them seemed reasonable for me. Related previous patches: rGf224820b45c6847b91071da8d7ade59f373b96f3 Reviewers: NoQ, krememek, Szelethus, baloghadamsoftware Reviewed By: Szelethus Patch by Balázs Benics! Differential Revision: https://reviews.llvm.org/D66733 llvm-svn: 370767
* [OpenCL] Drop spurious semicolon in generated file; NFCSven van Haastregt2019-09-031-1/+1
| | | | llvm-svn: 370744
* Fixit for -Wfinal-dtor-non-final-classDavid Bolvansky2019-09-032-2/+0
| | | | llvm-svn: 370740
OpenPOWER on IntegriCloud