aboutsummaryrefslogtreecommitdiff
path: root/clang/test
AgeCommit message (Collapse)AuthorFilesLines
2017-07-07[ObjC] Avoid the -Wunguarded-availability warnings for protocolAlex Lorenz1-0/+24
requirements in protocol/class/category declarations The unguarded availability warnings in the protocol requirements of a protocol /class/category declaration can be avoided. This matches the behaviour of Swift's diagnostics. The warnings for deprecated/unavailable protocols are preserved. rdar://33156429 Differential Revision: https://reviews.llvm.org/D35061 llvm-svn: 307368
2017-07-06Change remaining references to lit.util.capture to use subprocess.check_output.David L. Jones2-4/+5
Summary: The capture() function was removed in r306625. This should fix PGO breakages reported by Michael Zolotukhin. Reviewers: mzolotukhin Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35088 llvm-svn: 307320
2017-07-06Reject attempts to build a module without -fmodules, rather than silently ↵Richard Smith3-11/+16
doing weird things. llvm-svn: 307316
2017-07-06 [Objective-C] Fix non-determinism in clangMandeep Singh Grang1-0/+45
Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet). Reviewers: dblaikie, davide, rsmith Reviewed By: dblaikie Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D34860 llvm-svn: 307296
2017-07-06This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it showsSjoerd Meijer4-1976/+355
problems in testing, see comments in D34161 for some more details. A fix is in progres in D35011, but a revert seems better now as the fix will probably take some more time to land. llvm-svn: 307277
2017-07-06[OpenCL] Test on image access modifiers and image type can only be a type of ↵Egor Churaev1-5/+28
a function argument. Reviewers: Anastasia Reviewed By: Anastasia Subscribers: yaxunl, cfe-commits, bader Differential Revision: https://reviews.llvm.org/D34980 llvm-svn: 307238
2017-07-06[modules ts] Do not emit strong function definitions from the module ↵Richard Smith3-0/+90
interface unit in every user. llvm-svn: 307232
2017-07-05Fix test case in pre-C++11 mode; address Aaron Ballman's code review.Douglas Gregor1-1/+1
llvm-svn: 307202
2017-07-05Cope with Range-v3's CONCEPT_REQUIRES idiomDouglas Gregor1-0/+26
llvm-svn: 307197
2017-07-05Customize the SFINAE diagnostics for enable_if to provide the failed condition.Douglas Gregor2-5/+5
When enable_if disables a particular overload resolution candidate, rummage through the enable_if condition to find the specific condition that caused the failure. For example, if we have something like: template< typename Iter, typename = std::enable_if_t<Random_access_iterator<Iter> && Comparable<Iterator_value_type<Iter>>>> void mysort(Iter first, Iter last) {} and we call "mysort" with "std::list<int>" iterators, we'll get a diagnostic saying that the "Random_access_iterator<Iter>" requirement failed. If we call "mysort" with "std::vector<something_not_comparable>", we'll get a diagnostic saying that the "Comparable<...>" requirement failed. llvm-svn: 307196
2017-07-05[Sema] Don't allow -Wunguarded-availability to be silenced with redeclsErik Pilkington7-31/+87
Differential revision: https://reviews.llvm.org/D33816 llvm-svn: 307175
2017-07-05Address comments that escaped D33333Erich Keane2-44/+43
Patch By: Jen Yu Differential Revision:https://reviews.llvm.org/D34671 llvm-svn: 307172
2017-07-05[modules ts] Improve merging of module-private declarations.Richard Smith1-0/+33
These cases occur frequently for declarations in the global module (above the module-declaration) in a Modules TS module interface. When we merge a definition from another module into such a module-private definition, ensure that we transitively make everything lexically within that definition visible to that translation unit. llvm-svn: 307129
2017-07-05[AMDGPU] Fix size and alignment of size_t and pointer typesYaxun Liu7-34/+153
Differential Revision: https://reviews.llvm.org/D34995 llvm-svn: 307121
2017-07-05[modules ts] Declarations from a module interface unit are only visible outsideRichard Smith5-3/+71
the module if declared in an export block. llvm-svn: 307115
2017-07-04[AMDGPU] Fix regressions on mesa/clover with libclc due to address spaceYaxun Liu1-0/+2
Currently AMDGPUTargetInfo does not initialize AddrSpaceMap in constructor, which causes regressions in mesa/clover with libclc. This patch fixes that. Differential Revision: https://reviews.llvm.org/D34987 llvm-svn: 307105
2017-07-04[index] Index nested name qualifiers in a forward declaration of aAlex Lorenz1-0/+16
class template specialization rdar://33122110 llvm-svn: 307074
2017-07-04[OpenCL] Rename err_opencl_enqueue_kernel_expected_typeJoey Gouly1-8/+8
Rename err_opencl_enqueue_kernel_expected_type so that other builtins can use the same diagnostic. https://reviews.llvm.org/D34948 llvm-svn: 307067
2017-07-04[CodeGen] Check key function for typeinfo importShoaib Meenai1-2/+8
If the imported class does not have a key function, we should emit its typeinfo locally instead of attempting to import it. llvm-svn: 307052
2017-07-04[Sema] Make BreakContinueFinder handle nested loops.Eli Friedman2-0/+60
We don't care about break or continue statements that aren't associated with the current loop, so make sure the visitor doesn't find them. Fixes https://bugs.llvm.org/show_bug.cgi?id=32648 . Differential Revision: https://reviews.llvm.org/D34568 llvm-svn: 307051
2017-07-03[clang] Implement -Wcast-qual for C++Roman Lebedev2-0/+171
Summary: This way, the behavior of that warning flag more closely resembles that of GCC. Do note that there is at least one false-negative (see FIXME in tests). Fixes PR4802. Testing: ``` ninja check-clang-sema check-clang-semacxx ``` Reviewers: dblaikie, majnemer, rnk Reviewed By: dblaikie, rnk Subscribers: mclow.lists, cfe-commits, alexfh, rnk Differential Revision: https://reviews.llvm.org/D33102 llvm-svn: 307045
2017-07-03[index] Remove 'implicit' role for message sends in implicit ObjCAlex Lorenz1-0/+25
property references rdar://32375673 llvm-svn: 307016
2017-07-03Add a fixit for -Wobjc-protocol-property-synthesisAlex Lorenz4-4/+18
rdar://32132756 Differential Revision: https://reviews.llvm.org/D34886 llvm-svn: 307014
2017-07-02fix trivial typos in comments; NFCHiroshi Inoue1-1/+1
llvm-svn: 306969
2017-07-01Add an option group for deprecated warnings. Add the removedJoerg Sonnenberger1-0/+4
-fslp-vectorize-aggressive and -fno-slp-vectorize-aggressive flags back under this group and test for the warning. Document the future removal in the ReleaseNotes. Differential Revision: https://reviews.llvm.org/D34926 llvm-svn: 306965
2017-07-01[modules] Teach clang how to merge typedef over anonymous structs in C mode.Vassil Vassilev1-1/+1
In C mode clang fails to merge the textually included definition with the one imported from a module. The C lookup rules fail to find the imported definition because its linkage is internal in non C++ mode. This patch reinstates some of the ODR merging rules for typedefs of anonymous tags for languages other than C++. Patch by Raphael Isemann and me (D34510). llvm-svn: 306964
2017-07-01[OpenMP] Fix mapping of scalars for combined directivesJonas Hahnfeld1-0/+26
Combined directives like 'target parallel' have two captured statements. Sema has to check the right one from the right direction. Previously, Sema::IsOpenMPCapturedByRef would return false for mapped scalars on combined directives. This results in a wrong signature of the outlined function which triggers an assertion: void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed. Fixes PR30975 (and PR31985). New function was taken from clang-ykt. Differential Revision: https://reviews.llvm.org/D34888 llvm-svn: 306956
2017-07-01Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak2-5/+17
Summary: Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the documentation to fix an error -- I had used the wrong syntax for a link. llvm-svn: 306948
2017-07-01Revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak2-17/+5
Summary: The commit caused a documentation breakage. llvm-svn: 306946
2017-07-01[Driver] Add -fdiagnostics-hotness-thresholdBrian Gesiak2-5/+17
Summary: Depends on https://reviews.llvm.org/D34867. Add a Clang frontend option to enable optimization remark hotness thresholds, which were added to LLVM in https://reviews.llvm.org/D34867. This prevents diagnostics that do not meet a minimum hotness threshold from being output. When generating optimization remarks for large codebases with a ton of cold code paths, this option can be used to limit the optimization remark output at a reasonable size. Discussion of this change can be read here: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html Reviewers: anemet, davidxl, hfinkel Reviewed By: anemet Subscribers: fhahn, cfe-commits Differential Revision: https://reviews.llvm.org/D34868 llvm-svn: 306945
2017-07-01Update clang support for -mexecute-only/-mpure-code for backend change to ↵Eric Christopher2-72/+78
use subtarget feature rather than command line option. llvm-svn: 306928
2017-07-01[ODRHash] Revert r305104 - Skip inline namespaces when hashing.Richard Trieu1-0/+18
Test inline namespaces and handle them in the ODR hash again. llvm-svn: 306926
2017-07-01[Driver] Check that the iOS deployment target is iOS 10 or earlier ifAkira Hatanaka1-0/+35
the target is 32-bit. The following changes are made to the driver since 32-bit apps do not run on iOS 11 or later: - If the deployment target is set explicitly, either with a command-line option or an environment variable, the driver should report an error if the version is greater than iOS 10. - In the case where the deployment target is not set explicitly and the default is inferred from the target triple or SDK version, it should use a maximum default of iOS 10.99.99. rdar://problem/32230613 Differential Revision: https://reviews.llvm.org/D34529 llvm-svn: 306922
2017-07-01[Modules] Implement ODR-like semantics for tag types in C/ObjCBruno Cardoso Lopes7-13/+86
Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 llvm-svn: 306918
2017-07-01Change enumerator default linkage type for CBruno Cardoso Lopes1-1/+1
Redeclaration lookup should never find hidden enumerators in C, because they do not have linkage (C11 6.2.2/6) The linkage of an enumerator should be VisibleNoLinkage, and isHiddenDeclarationVisible should be checking hasExternalFormalLinkage. This is was reviewed as part of D31778, but splitted into a different commit for clarity. rdar://problem/31909368 llvm-svn: 306917
2017-06-30Fix PR 33189: Clang assertion on template destructor declarationHubert Tong1-0/+6
Summary: This patch aims to fix the bug reported at https://bugs.llvm.org/show_bug.cgi?id=33189. Clang hits an assertion when a template destructor declaration is present. This is caused by later processing that does not expect to encounter a template when looking at a destructor. The resolution is to treat the destructor as being not declared when later processing is interested in the properties of the destructor of a class. Reviewers: rcraik, hubert.reinterpretcast, aaron.ballman, rsmith Reviewed By: rsmith Subscribers: rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D33833 Patch by Kuang He! llvm-svn: 306905
2017-06-30[ODRHash] Support Type TemplateArgumentRichard Trieu1-0/+34
llvm-svn: 306904
2017-06-30[Parse] Use normalized attr name for late-parsing checks.George Burgess IV1-0/+4
llvm-svn: 306899
2017-06-30[Profile] Do not assign counters to functions without bodiesVedant Kumar2-0/+30
The root cause of the issues reported in D32406 and D34680 is that clang instruments functions without bodies. Make it stop doing that, and also teach it how to use old (incorrectly generated) profiles without crashing. llvm-svn: 306883
2017-06-30Fix a typo. NFC.Vedant Kumar1-1/+1
llvm-svn: 306882
2017-06-30[X86] Add RDRND feature to Goldmont. Add MOVBE to all Atom CPUs.Craig Topper1-0/+2
Diffential Revision: https://reviews.llvm.org/D34842 llvm-svn: 306851
2017-06-30Move ClassReplacements.cpp test from clang-rename tests to theAlex Lorenz1-11/+0
clang-apply-replacements tests The ClassReplacements.cpp test in the clang-rename tests uses clang-apply-replacements. I moved it back to the clang-tools-extra repository for now to ensure that the clang-rename tests can pass when clang is compiled without clang-tools-extra. llvm-svn: 306843
2017-06-30[refactor] Move clang-rename into the clang repositoryAlex Lorenz33-0/+556
The core engine of clang-rename will be used for local and global renames in the new refactoring engine, as mentioned in http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html. The clang-rename tool is still supported but might get deprecated in the future. Differential Revision: https://reviews.llvm.org/D34696 llvm-svn: 306840
2017-06-30[objc] Don't require null-check and don't emit memset when result is ignored ↵Kuba Mracek2-1/+44
for struct-returning method calls [clang part] This fixes an issue with the emission of lifetime markers for struct-returning Obj-C msgSend calls. When the result of a struct-returning call is ignored, the temporary storage is only marked with lifetime markers in one of the two branches of the nil-receiver-check. The check is, however, not required when the result is unused. If we still need to emit the check (due to consumer arguments), let's not emit the memset to zero out the result if it's unused. This fixes a use-after-scope false positive with AddressSanitizer. Differential Revision: https://reviews.llvm.org/D34834 llvm-svn: 306837
2017-06-30[MS] Test that deleting destructor thunks are not exportedReid Kleckner1-0/+10
The MSVC linker emits the LNK4102 warning if they are. llvm-svn: 306836
2017-06-30Revert "[CodeGen] Propagate dllexport to thunks"Reid Kleckner1-9/+0
This reverts r306770, it causes LNK4102 warnings in MSVC builds. llvm-svn: 306835
2017-06-30Driver: honor -nostdinc and -isystem-after on CrossWindowsSaleem Abdulrasool1-0/+5
This changes CrossWindows to look for -nostdinc instead of -nostdlibinc. In addition, fixes a bug where -isystem-after options would be dropped when called with -nostdinc. Patch by Dave Lee! llvm-svn: 306829
2017-06-30[OpenCL] Add function name to extension diagnosticJoey Gouly1-1/+1
Slightly improve the diagnostic by including the function name. llvm-svn: 306827
2017-06-30[OPENMP] Initial support for taskloop reductions.Alexey Bataev2-16/+16
Add sema/parsupping ort for taskloop [simd] reductions. llvm-svn: 306825
2017-06-30ARMV8-A archkind and target defines helper functionsSjoerd Meijer2-2/+4
This introduces helper functions that set target defines for different ARMV8-A architecture kinds. It fixes an issue that the v8.1 define ARM_FEATURE_QRDMX was not set for v8.2. These helper functions make things more “scalable” if we want to add ARMv8.3 at some point, and a cleanup has been done to hold the architecture kind in one variable (instead of one for each). Differential Revision: https://reviews.llvm.org/D34686 llvm-svn: 306805