summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] Add fixit for unused lambda capturesAlexander Shaposhnikov2018-07-166-12/+158
| | | | | | | | | | | | | This diff adds a fixit to suggest removing unused lambda captures in the appropriate diagnostic. Patch by Andrew Comminos! Test plan: make check-all Differential revision: https://reviews.llvm.org/D48845 llvm-svn: 337148
* [MinGW] Automatically mangle Windows-specific entry points as CMartin Storsjo2018-07-162-0/+31
| | | | | | | | | | | | | | This mangles entry points wmain, WinMain, wWinMain or DllMain as C functions, to match the ABI for these functions. We already did the same for these functions in MSVC mode, but we also should do the same in the Itanium ABI. This fixes PR38124. Differential Revision: https://reviews.llvm.org/D49354 llvm-svn: 337146
* Run thread safety tests with both lock and capability attributes; NFC to the ↵Aaron Ballman2018-07-151-57/+59
| | | | | | | | analysis behavior. Patch thanks to Aaron Puchert. llvm-svn: 337125
* [CMake] Use libc++ and compiler-rt for sanitizersPetr Hosek2018-07-151-1/+3
| | | | | | | | | When building runtimes for Linux as part of Fuchsia toolchain, use libc++ and compiler-rt for sanitizers. Differential Revision: https://reviews.llvm.org/D49331 llvm-svn: 337117
* Add caching when looking up coroutine_traitsBrian Gesiak2018-07-143-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently clang looks up the coroutine_traits ClassTemplateDecl everytime it looks up the promise type. This is unnecessary as coroutine_traits doesn't change between promise type lookups. This diff caches the coroutine_traits lookup. Patch by Tanoy Sinha! Test Plan: I added log statements in the new lookupCoroutineTraits function to ensure that LookupQualifiedName was only called once even when multiple coroutines existed in the source file. Reviewers: modocache, GorNishanov Reviewed By: modocache Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48981 llvm-svn: 337103
* Revert "[ThinLTO] Ensure we always select the same function copy to import"Teresa Johnson2018-07-141-2/+3
| | | | | | This reverts commit r337051. llvm-svn: 337082
* [ThinLTO] Ensure we always select the same function copy to importTeresa Johnson2018-07-131-3/+2
| | | | | | | Clang change to reflect the FunctionsToImportTy type change in the llvm changes for D48670. llvm-svn: 337051
* [Hexagon] Fix hvx-length feature name in testcasesKrzysztof Parzyszek2018-07-132-2/+2
| | | | llvm-svn: 337049
* Make BuiltinType constructor private, and befriend ASTContext.Richard Smith2018-07-131-1/+4
| | | | | | | | This reflects the fact that only ASTContext should ever create an instance of BuiltinType, and matches what we do for all the other Type subclasses. llvm-svn: 337048
* Use external layout information to layout bit-fields for MS ABI.Richard Smith2018-07-133-1/+45
| | | | | | | | Patch by Aleksandr Urakov! Differential Revision: https://reviews.llvm.org/D49227 llvm-svn: 337047
* CodeGen: specify alignment + inbounds for automatic variable initializationJF Bastien2018-07-134-37/+55
| | | | | | | | | | Summary: Automatic variable initialization was generating default-aligned stores (which are deprecated) instead of using the known alignment from the alloca. Further, they didn't specify inbounds. Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49209 llvm-svn: 337041
* [X86] Change the rounding mode used when testing the sqrt_round intrinsics.Craig Topper2018-07-131-42/+12
| | | | | | Using CUR_DIRECTION is not a realistic scenario. That is equivalent to the intrinsic without rounding. llvm-svn: 337040
* SafeStack: Add builtins to read unsafe stack top/bottomVlad Tsyrklevich2018-07-132-2/+16
| | | | | | | | | | | | | | | | | | | | Summary: Introduce built-ins to read the unsafe stack top and bottom. The unsafe stack top is required to implement garbage collection scanning for Oilpan. Currently there is already a built-in 'get_unsafe_stack_start' to read the bottom of the unsafe stack, but I chose to duplicate this API because 'start' is ambiguous (e.g. Oilpan uses WTF::GetStackStart to read the safe stack top.) Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D49152 llvm-svn: 337037
* PR15730/PR16986 Allow dependently typed vector_size types.Erich Keane2018-07-1322-87/+560
| | | | | | | | | | | | | | | | | As listed in the above PRs, vector_size doesn't allow dependent types/values. This patch introduces a new DependentVectorType to handle a VectorType that has a dependent size or type. In the future, ALL the vector-types should be able to create one of these to handle dependent types/sizes as well. For example, DependentSizedExtVectorType could likely be switched to just use this instead, though that is left as an exercise for the future. Differential Revision: https://reviews.llvm.org/D49045 llvm-svn: 337036
* Fix PR34668 - P0704R1 implementation is too permissiveNicolas Lesser2018-07-132-2/+6
| | | | | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=34668 Pretty straightforward. Reviewers: rsmith, Rakete1111 Reviewed By: Rakete1111 Subscribers: Rakete1111, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38075 llvm-svn: 337017
* [OpenMP] Initialize data sharing stack for SPMD caseGheorghe-Teodor Bercea2018-07-138-8/+35
| | | | | | | | | | | | | | Summary: In the SPMD case, we need to initialize the data sharing and globalization infrastructure. This covers the case when an SPMD region calls a function in a different compilation unit. Reviewers: ABataev, carlo.bertolli, caomhin Reviewed By: ABataev Subscribers: Hahnfeld, jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D49188 llvm-svn: 337015
* [NFC] Rename clang::AttributeList to clang::ParsedAttrErich Keane2018-07-1326-1143/+1073
| | | | | | | Since The type no longer contains the 'next' item anymore, it isn't a list, so rename it to ParsedAttr to be more accurate. llvm-svn: 337005
* [Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fixAdam Balogh2018-07-134-23/+59
| | | | | | | | | | | | | | | | | | It was not possible to disable alpha.unix.cstring.OutOfBounds checker's reports since unix.Malloc checker always implicitly enabled the filter. Moreover if the checker was disabled from command line (-analyzer-disable-checker ..) the out of bounds warnings were nevertheless emitted under different checker names such as unix.cstring.NullArg, or unix.Malloc. This patch fixes the case sot that Malloc checker only enables implicitly the underlying modeling of strcpy, memcpy etc. but not the warning messages that would have been emmitted by alpha.unix.cstring.OutOfBounds Patch by: Dániel Krupp Differential Revision: https://reviews.llvm.org/D48831 llvm-svn: 337000
* [analyzer][UninitializedObjectChecker] Fixed captured lambda variable nameKristof Umann2018-07-132-21/+69
| | | | | | Differential Revision: https://reviews.llvm.org/D48291 llvm-svn: 336995
* [analyzer][UninitializedObjectChecker] Support for MemberPointerTypesKristof Umann2018-07-132-37/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D48325 llvm-svn: 336994
* PR38136: improve handling of template argument deduction of non-trailingRichard Smith2018-07-123-30/+106
| | | | | | | | | | | | | | | | | | | | | function parameter packs. This makes our handling of non-trailing function parameter packs consistent between the case of deduction at the top level in a function call and other cases where deduction encounters a non-trailing function parameter pack. Instead of treating a non-trailing pack and all later parameters as being non-deduced, we treat a non-trailing pack as exactly matching any explicitly-specified template arguments (or being an empty pack if there are no such arguments). This corresponds to the "never deduced" rule in [temp.deduct.call]p1, but generalized to all deduction contexts. Non-trailing template argument packs still result in the entire template argument list being treated as non-deduced, as specified in [temp.deduct.type]p9. llvm-svn: 336962
* Support linking static PIE binaries on NetBSDJoerg Sonnenberger2018-07-122-0/+17
| | | | llvm-svn: 336947
* PR38141: check whether noexcept-specifications are equivalent in redeclarationsRichard Smith2018-07-123-5/+21
| | | | llvm-svn: 336946
* AttributeList de-listifying:Erich Keane2018-07-1229-1380/+1061
| | | | | | | | | | | Basically, "AttributeList" loses all list-like mechanisms, ParsedAttributes is switched to use a TinyPtrVector (and a ParsedAttributesView is created to have a non-allocating attributes list). DeclaratorChunk gets the later kind, Declarator/DeclSpec keep ParsedAttributes. Iterators are added to the ParsedAttribute types so that for-loops work. llvm-svn: 336945
* [Driver] Conform warn_drv_object_size_disabled_O0 to DefaultWarnNoErrorVedant Kumar2018-07-122-3/+4
| | | | | | | | | | | | | | | This diagnostic triggers when -fsanitize=object-size is explicitly specified but will be a no-op (i.e, at -O0). This diagnostic should not fail a -Werror build because it's just an explanatory note to the user. It's not always actionable. For example, a user may not be able to simply disable object-size, because they want it enabled in optimized builds. rdar://42128447 llvm-svn: 336937
* [Hexagon] Fix testcases failing after r336933Krzysztof Parzyszek2018-07-123-1589/+1605
| | | | llvm-svn: 336936
* [Hexagon] Diagnose intrinsics not supported by selected CPU/HVXKrzysztof Parzyszek2018-07-1212-3/+966
| | | | llvm-svn: 336933
* Add tests for function conversions in conversion function templateRichard Smith2018-07-122-0/+20
| | | | | | deduction. llvm-svn: 336931
* [C++17] Disallow lambdas in template parameters (PR33696).Nicolas Lesser2018-07-1211-60/+86
| | | | | | | | | | | | | | Summary: This revision disallows lambdas in template parameters, as reported in PR33696. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37442 llvm-svn: 336930
* [Tooling] Make standalone executor support user-provided vfs.Eric Liu2018-07-122-3/+6
| | | | llvm-svn: 336928
* [C++11] Fix warning when dropping cv-qualifiers when assigning to a ↵Nicolas Lesser2018-07-122-16/+48
| | | | | | reference with a braced initializer list llvm-svn: 336922
* Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific ↵Bruno Cardoso Lopes2018-07-1210-66/+15
| | | | | | | | | | | | | | | LangOpts" This reverts commit f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660. This change shouldn't be affecting `@import` behavior, but turns out it is: https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-12570166563122a513-f36a-4c87-8ed7-cbc36a1ec144 Working on a reduced testcase for this, reverting in the meantime. rdar://problem/42102222 llvm-svn: 336920
* [Tooling] Get working directory properly without assuming real file system.Eric Liu2018-07-121-3/+7
| | | | llvm-svn: 336910
* [analyzer][UninitializedObjectChecker] Moved non-member functions out of the ↵Kristof Umann2018-07-121-17/+17
| | | | | | | | | | | anonymous namespace As the code for the checker grew, it became increasinly difficult to see whether a function was global or statically defined. In this patch, anything that isn't a type declaration or definition was moved out of the anonymous namespace and is marked as static. llvm-svn: 336901
* [ASTImporter] Fix infinite recursion on function import with struct ↵Gabor Marton2018-07-122-20/+98
| | | | | | | | | | | | | | | | | | | definition in parameters Summary: Importing a function having a struct definition in the parameter list causes a crash in the importer via infinite recursion. This patch avoids the crash and reports such functions as not supported. Unit tests make sure that normal struct definitions inside function bodies work normally on the other hand and LLDB-like type imports also do. Reviewers: a.sidorin, martong Differential Revision: https://reviews.llvm.org/D47946 Patch by Zoltan Gera! llvm-svn: 336898
* [ASTImporter] Refactor Decl creationGabor Marton2018-07-129-460/+594
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Generalize the creation of Decl nodes during Import. With this patch we do the same things after and before a new AST node is created (::Create) The import logic should be really simple, we create the node, then we mark that as imported, then we recursively import the parts for that node and then set them on that node. However, the AST is actually a graph, so we have to handle circles. If we mark something as imported (`MapImported()`) then we return with the corresponding `To` decl whenever we want to import that node again, this way circles are handled. In order to make this algorithm work we must ensure things, which are handled in the generic CreateDecl<> template: * There are no `Import()` calls in between any node creation (::Create) and the `MapImported()` call. * Before actually creating an AST node (::Create), we must check if the Node had been imported already, if yes then return with that one. One very important case for this is connected to templates: we may start an import both from the templated decl of a template and from the template itself. Now, the virtual `Imported` function is called in `ASTImporter::Impor(Decl *)`, but only once, when the `Decl` is imported. One point of this refactor is to separate responsibilities. The original `Imported()` had 3 responsibilities: - notify subclasses when an import happened - register the decl into `ImportedDecls` - initialise the Decl (set attributes, etc) Now all of these are in separate functions: - `Imported` - `MapImported` - `InitializeImportedDecl` I tried to check all the clients, I executed tests for `ExternalASTMerger.cpp` and some unittests for lldb. Reviewers: a.sidorin, balazske, xazax.hun, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47632 llvm-svn: 336896
* Fix deduction for conversion function templates converting to referenceRichard Smith2018-07-112-4/+97
| | | | | | | | | | | | | | | | | | | types. We previously tried to use the "parameter is a reference" logic here, but that doesn't work because it gets P and A backwards. Instead, add a separate implementation of the "deduced A can be less qualified than A" rule. This also exposes that we incorrectly stripped cv-qualifiers from the referent of A if it was a reference. However, if we don't do that, we get the wrong results when P is a reference. In an attempt to match what sanity dictates and what other implementations are doing, we now remove cv-qualifiers from A and P unless both are reference types. I've brought this up on the core reflector too, to try to get the standard fixed. llvm-svn: 336867
* os_log: When there are multiple privacy annotations in the formatAkira Hatanaka2018-07-112-7/+8
| | | | | | | | | | | string, choose the strictest one instead of the last. Also fix an undefined behavior. Move the pointer update to a later point to avoid adding StringRef::npos to the pointer. rdar://problem/40706280 llvm-svn: 336863
* Fix determination of whether one set of cvr-qualifiers is compatibleRichard Smith2018-07-112-6/+16
| | | | | | | | | | with another in template argument deduction. We happened to typically get away with getting this wrong, because the cases where we'd produce a bogus deduction were caught by the final "deduced A is compatible with A" check. llvm-svn: 336852
* [FileCheck] Add -allow-deprecated-dag-overlap to failing clang testsJoel E. Denny2018-07-1143-625/+625
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47172 llvm-svn: 336844
* Fix setting of empty implicit-section-name attributePetr Pavlu2018-07-112-4/+76
| | | | | | | | | | | | | | | | | | | Code in `CodeGenModule::SetFunctionAttributes()` could set an empty attribute `implicit-section-name` on a function that is affected by `#pragma clang text="section"`. This is incorrect because the attribute should contain a valid section name. If the function additionally also used `__attribute__((section("section")))` then this could result in emitting the function in a section with an empty name. The patch fixes the issue by removing the problematic code that sets empty `implicit-section-name` from `CodeGenModule::SetFunctionAttributes()` because it is sufficient to set this attribute only from a similar code in `setNonAliasAttributes()` when the function is emitted. Differential Revision: https://reviews.llvm.org/D48916 llvm-svn: 336842
* [NFC] typoJF Bastien2018-07-111-1/+1
| | | | llvm-svn: 336840
* [NFC] Replace usage of QualType.getTypePtr()-> with operator->Erich Keane2018-07-111-1/+1
| | | | llvm-svn: 336836
* [analyzer] Track multiple raw pointer symbols in DanglingInternalBufferChecker.Reka Kovacs2018-07-112-18/+74
| | | | | | | | | | | | Previously, the checker only tracked one raw pointer symbol for each container object. But member functions returning a pointer to the object's inner buffer may be called on the object several times. These pointer symbols are now collected in a set inside the program state map and thus all of them is checked for use-after-free problems. Differential Revision: https://reviews.llvm.org/D49057 llvm-svn: 336835
* Revert "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with ↵Eric Liu2018-07-114-94/+21
| | | | | | | | | | the requested name" This reverts commit r336807. This breaks users of ClangTool::mapVirtualFile. Will try to investigate a fix. See also the discussion on https://reviews.llvm.org/D48903 llvm-svn: 336831
* [AST] Fix for structural equivalence tests in rL336776.Balazs Keri2018-07-111-5/+6
| | | | llvm-svn: 336817
* [clangd] Uprank delcarations when "using q::name" is present in the main fileKirill Bobyrev2018-07-112-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Having `using qualified::name;` for some symbol is an important signal for clangd code completion as the user is more likely to use such symbol. This patch helps to uprank the relevant symbols by saving UsingShadowDecl in the new field of CodeCompletionResult and checking whether the corresponding UsingShadowDecl is located in the main file later in ClangD code completion routine. While the relative importance of such signal is a subject to change in the future, this patch simply bumps DeclProximity score to the value of 1.0 which should be enough for now. The patch was tested using `$ ninja check-clang check-clang-tools` No unexpected failures were noticed after running the relevant testsets. Reviewers: sammccall, ioeric Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49012 llvm-svn: 336810
* [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the ↵Simon Marchi2018-07-114-21/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requested name Summary: InMemoryFileSystem::status behaves differently than RealFileSystem::status. The Name contained in the Status returned by RealFileSystem::status will be the path as requested by the caller, whereas InMemoryFileSystem::status returns the normalized path. For example, when requested the status for "../src/first.h", RealFileSystem returns a Status with "../src/first.h" as the Name. InMemoryFileSystem returns "/absolute/path/to/src/first.h". The reason for this change is that I want to make a unit test in the clangd testsuite (where we use an InMemoryFileSystem) to reproduce a bug I get with the clangd program (where a RealFileSystem is used). This difference in behavior "hides" the bug in the unit test version. In general, I guess it's good if InMemoryFileSystem works as much as possible like RealFileSystem. Doing so made the FileEntry::RealPathName value (assigned in FileManager::getFile) wrong when using the InMemoryFileSystem. That's because it assumes that vfs::File::getName will always return the real path. I changed to to use FileSystem::getRealPath instead. Subscribers: ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D48903 llvm-svn: 336807
* [mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' optionsVladimir Stefanovic2018-07-113-0/+32
| | | | | | | | | '-mvirt'/'-mno-virt' enables/disables Virtualization ASE. '-mginv'/'-mno-ginv' enables/disables GINV (Global Invalidate) ASE. Differential revision: https://reviews.llvm.org/D48982 llvm-svn: 336798
* [AST] Structural equivalence of methodsBalazs Keri2018-07-114-73/+619
| | | | | | | | | | | | | | | | | Summary: Added structural equivalence check for C++ methods. Improved structural equivalence tests. Added related ASTImporter tests. Reviewers: a.sidorin, szepet, xazax.hun, martong, a_sidorin Reviewed By: martong, a_sidorin Subscribers: a_sidorin, rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D48628 llvm-svn: 336776
OpenPOWER on IntegriCloud