summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA][HIP] Re-apply part of r372318.Michael Liao2019-09-191-2/+4
| | | | | | | | | | - r372318 causes violation of `use-of-uninitialized-value` detected by MemorySanitizer. Once `Viable` field is set to false, `FailureKind` needs setting as well as it will be checked during destruction if `Viable` is not true. - Revert the part trying to skip `std::vector` erasing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372356 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"Mitch Phillips2019-09-191-9/+7
| | | | | | | | Broke the msan buildbots (see comments on rL372318 for more details). This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372353 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r372325 - Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-2/+1
| | | | | | This corrects the testing issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372334 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-1/+2
| | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/17919 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372325 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unsafe member variable that wasn't needed; NFC.Aaron Ballman2019-09-191-2/+1
| | | | | | People use the AST dumping interface while debugging, so it's not safe to assume that a declaration will be dumped before a constant expression is dumped. This means the Context member may not get set properly and problems would happen. Rather than rely on the interface that requires the ASTContext, call the generic dump() interface instead; this allows us to remove the Context member variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372323 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-192-16/+152
| | | | | | | | | | | | | | | | | | | Allow setting a MinVersion, stating from which OpenCL version a builtin function is available, and a MaxVersion, stating from which OpenCL version a builtin function should not be available anymore. Guard some definitions of the "work-item" builtin functions according to the OpenCL versions from which they are available. Add the "vector data load and store" builtin functions (e.g. vload/vstore), whose signatures differ before and after OpenCL 2.0 in the pointer argument address spaces. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63504 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372321 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA][HIP] Fix typo in `BestViableFunction`Michael Liao2019-09-191-7/+9
| | | | | | | | | | | | | | | | | | | Summary: - Should consider viable ones only when checking SameSide candidates. - Replace erasing with clearing viable flag to reduce data moving/copying. - Add one and revise another one as the diagnostic message are more relevant compared to previous one. Reviewers: tra Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D67730 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372318 91177308-0d34-0410-b5e6-96231b3b80d8
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-191-1/+11
| | | | | | | | | | | | | | | | | | | | | | | The clang intrinsic __builtin_preserve_access_index() currently has signature: const void * __builtin_preserve_access_index(const void * ptr) This may cause compiler warning when: - parameter type is "volatile void *" or "const volatile void *", or - the assign-to type of the intrinsic does not have "const" qualifier. Further, this signature does not allow dereference of the builtin result pointer as it is a "const void *" type, which adds extra step for the user to do type casting. Let us change the signature to: PointerT __builtin_preserve_access_index(PointerT ptr) such that the result and argument types are the same. With this, directly dereferencing the builtin return value becomes possible. Differential Revision: https://reviews.llvm.org/D67734 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372294 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] PR43102: Fix an assertion and an out-of-bounds error for ↵Kristof Umann2019-09-182-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic location construction Summary: https://bugs.llvm.org/show_bug.cgi?id=43102 In today's edition of "Is this any better now that it isn't crashing?", I'd like to show you a very interesting test case with loop widening. Looking at the included test case, it's immediately obvious that this is not only a false positive, but also a very bad bug report in general. We can see how the analyzer mistakenly invalidated `b`, instead of its pointee, resulting in it reporting a null pointer dereference error. Not only that, the point at which this change of value is noted at is at the loop, rather then at the method call. It turns out that `FindLastStoreVisitor` works correctly, rather the supplied explodedgraph is faulty, because `BlockEdge` really is the `ProgramPoint` where this happens. {F9855739} So it's fair to say that this needs improving on multiple fronts. In any case, at least the crash is gone. Full ExplodedGraph: {F9855743} Reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, TWeaver Subscribers: JesperAntonsson, uabelho, Ka-Ka, bjope, whisperity, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66716 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372269 91177308-0d34-0410-b5e6-96231b3b80d8
* On PowerPC, Secure-PLT by default for FreeBSD 13 and higherDimitry Andric2019-09-181-1/+2
| | | | | | | | | | | | | | | | | | | Summary: In https://svnweb.freebsd.org/changeset/base/349351, FreeBSD 13 and higher transitioned to Secure-PLT for PowerPC. This part contains the changes in clang's PPC architecture defaults. Reviewers: emaste, jhibbits, hfinkel Reviewed By: jhibbits Subscribers: wuzish, nemanjai, krytarowski, kbarton, MaskRay, jsji, shchenz, steven.zhang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67119 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372261 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Fix for PR43349: Crash for privatized loop bound.Alexey Bataev2019-09-181-0/+16
| | | | | | | | If the variable, used in the loop boundaries, is not captured in the construct, this variable must be considered as undefined if it was privatized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372252 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-format][PR41899] PointerAlignment: Left leads to useless space in ↵Paul Hoad2019-09-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lambda intializer expression Summary: https://bugs.llvm.org/show_bug.cgi?id=41899 ```auto lambda = [&a = a]() { a = 2; };``` is formatted as ```auto lambda = [& a = a]() { a = 2; };``` With an extra space if PointerAlignment is set to Left > The space "& a" looks strange when there is no type in the lambda's intializer expression. This can be worked around with by setting "PointerAlignment: Right", but ideally "PointerAlignment: Left" would not add a space in this case. Reviewers: klimek, owenpan, krasimir, timwoj Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67718 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372249 91177308-0d34-0410-b5e6-96231b3b80d8
* make -frewrite-includes also rewrite conditions in #if/#elifLubos Lunak2019-09-181-120/+54
| | | | | | | | | | | | | | | Those conditions may use __has_include, which needs to be rewritten. The existing code has already tried to rewrite just __has_include, but it didn't work with macro expansion, so e.g. Qt's "#define QT_HAS_INCLUDE(x) __has_include(x)" didn't get handled properly. Since the preprocessor run knows what each condition evaluates to, just rewrite the entire condition. This of course requires that the -frewrite-include pass has the same setup as the following compilation, but that has always been the requirement. Differential Revision: https://reviews.llvm.org/D63508 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372248 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Suppress -Wformat diagnostics for bool types when printed using %hhdErik Pilkington2019-09-182-0/+18
| | | | | | | | | | | Also, add a diagnostic under -Wformat for printing a boolean value as a character. rdar://54579473 Differential revision: https://reviews.llvm.org/D66856 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372247 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-format][PR41964] Fix crash with SIGFPE when TabWidth is set to 0 and ↵Paul Hoad2019-09-183-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | line starts with tab Summary: clang-format 8.0 crashes with SIGFPE (floating point exception) when formatting following file: app.cpp: void a() { //line starts with '\t' } $ clang-format -style='{TabWidth: 0}' app.cpp Reviewers: owenpan, klimek, russellmcc, timwoj Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67670 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372246 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] P1331R2: Allow transient use of uninitialized objects inRichard Smith2019-09-184-118/+220
| | | | | | constant evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372237 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Allow multiple context selectors in the context selectorAlexey Bataev2019-09-183-100/+128
| | | | | | | | | sets. According to OpenMP 5.0, context selector set might include several context selectors, separated with commas. Patch fixes this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372235 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r372082 "[Clang] Pragma vectorize_width() implies vectorize(enable)"Hans Wennborg2019-09-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This broke the Chromium build. Consider the following code: float ScaleSumSamples_C(const float* src, float* dst, float scale, int width) { float fsum = 0.f; int i; #if defined(__clang__) #pragma clang loop vectorize_width(4) #endif for (i = 0; i < width; ++i) { float v = *src++; fsum += v * v; *dst++ = v * scale; } return fsum; } Compiling at -Oz, Clang now warns: $ clang++ -target x86_64 -Oz -c /tmp/a.cc /tmp/a.cc:1:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] this suggests it's not actually enabling vectorization hard enough. At -Os it asserts instead: $ build.release/bin/clang++ -target x86_64 -Os -c /tmp/a.cc clang-10: /work/llvm.monorepo/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2734: void llvm::InnerLoopVectorizer::emitMemRuntimeChecks(llvm::Loop*, llvm::BasicBlock*): Assertion ` !BB->getParent()->hasOptSize() && "Cannot emit memory checks when optimizing for size"' failed. Of course neither of these are what the developer expected from the pragma. > Specifying the vectorization width was supposed to implicitly enable > vectorization, except that it wasn't really doing this. It was only > setting the vectorize.width metadata, but not vectorize.enable. > > This should fix PR27643. > > Differential Revision: https://reviews.llvm.org/D66290 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372225 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Pass "xgot" flag as a subtarget featureSimon Atanasyan2019-09-182-7/+7
| | | | | | | | | We need "xgot" flag in the MipsAsmParser to implement correct expansion of some pseudo instructions in case of using 32-bit GOT (XGOT). MipsAsmParser does not have reference to MipsSubtarget but has a reference to "feature bit set". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372220 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling.Simon Pilgrim2019-09-181-5/+2
| | | | | | The static analyzer noticed that we were dereferencing it even when the default null value was being used. Further investigation showed that we never explicitly set the parameter so I've just removed it entirely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372217 91177308-0d34-0410-b5e6-96231b3b80d8
* [lldb] Print better diagnostics for user expressions and modulesRaphael Isemann2019-09-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions. For example, in the expression below the user made a type error, but it's not clear from the diagnostic what went wrong: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: invalid operands to binary expression ('int' and 'double') ``` This patch enables full Clang diagnostics in our expression evaluator. After this patch the diagnostics for the expression look like this: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: <user expression 1>:1:54: invalid operands to binary expression ('int' and 'float') printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) ~~~~~~^~~~ ``` To make this possible, we now emulate a user expression file within our diagnostics. This prevents that the user is exposed to our internal wrapper code we inject. Note that the diagnostics that refer to declarations from the debug information (e.g. 'note' diagnostics pointing to a called function) will not be improved by this as they don't have any source locations associated with them, so caret or line printing isn't possible. We instead just suppress these diagnostics as we already do with warnings as they would otherwise just be a context message without any context (and the original diagnostic in the user expression should be enough to explain the issue). Fixes rdar://24306342 Reviewers: JDevlieghere, aprantl, shafik, #lldb Reviewed By: JDevlieghere, #lldb Subscribers: usaxena95, davide, jingham, aprantl, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65646 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372203 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Update clang for removal of vfp2d16 and vfp2d16spEli Friedman2019-09-172-4/+3
| | | | | | | | | | Matching fix for https://reviews.llvm.org/D67375 (r372186). Differential Revision: https://reviews.llvm.org/D67467 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372187 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Split of versions of -Wimplicit-{float,int}-conversion for ↵Erik Pilkington2019-09-172-28/+65
| | | | | | | | | | | | | Objective-C BOOL Also, add a diagnostic group, -Wobjc-signed-char-bool, to control all these related diagnostics. rdar://51954400 Differential revision: https://reviews.llvm.org/D67559 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372183 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore exception specifier mismatch when merging redeclarationsReid Kleckner2019-09-171-1/+6
| | | | | | | | | | | | | | | | | | Exception specifiers are now part of the function type in C++17. Normally, it is illegal to redeclare the same function or specialize a template with a different exception specifier, but under -fms-compatibility, we accept it with a warning. Without this change, the function types would not match due to the exception specifier, and clang would claim that the types were "incompatible". Now we emit the warning and merge the redeclaration as we would in C++14 and earlier. Fixes PR42842, which is about compiling _com_ptr_t in C++17. Based on a patch by Alex Fusco <alexfusco@google.com>! Differential Revision: https://reviews.llvm.org/D67590 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372178 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Introduce attribute for declare variant directive.Alexey Bataev2019-09-173-1/+87
| | | | | | | | Added attribute for declare variant directive. It will allow to handle declare variant directive at the codegen and will allow to add extra checks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372147 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-format] Fix cleanup of `AnnotatedLine` to include children nodes.Yitzhak Mandelbaum2019-09-171-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: AnnotatedLine has a tree structure, and things like the body of a lambda will be a child of the lambda expression. For example, [&]() { foo(a); }; will have an AnnotatedLine with a child: [&]() {}; '- foo(a); Currently, when the `Cleaner` class analyzes the affected lines, it does not cleanup the lines' children nodes, which results in missed cleanup opportunities, like the lambda body in the example above. This revision extends the algorithm to visit children, thereby fixing the above problem. Patch by Eric Li. Reviewers: krasimir Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67659 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372129 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SpellingNotCalculated to Attribute Enums to suppress UBSan warningsErich Keane2019-09-173-0/+8
| | | | | | | UBSan downstreams noticed that the assignment of SpellingNotCalculated to the spellings caused warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372124 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Tidy up some comments; NFCSven van Haastregt2019-09-171-10/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372119 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide implementation details in namespaces.Benjamin Kramer2019-09-171-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372113 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Pragma vectorize_width() implies vectorize(enable)Sjoerd Meijer2019-09-171-0/+8
| | | | | | | | | | | | Specifying the vectorization width was supposed to implicitly enable vectorization, except that it wasn't really doing this. It was only setting the vectorize.width metadata, but not vectorize.enable. This should fix PR27643. Differential Revision: https://reviews.llvm.org/D66290 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372082 91177308-0d34-0410-b5e6-96231b3b80d8
* [RISCV] Define __riscv_cmodel_medlow and __riscv_cmodel_medany correctlyKito Cheng2019-09-171-2/+8
| | | | | | | | | | | | | | RISC-V LLVM was only implement small/medlow code model, so it defined __riscv_cmodel_medlow directly without check. Now, we have medium/medany code model in RISC-V back-end, it should define according the actually code model. Reviewed By: lewis-revill Differential Revision: https://reviews.llvm.org/D67065 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372078 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix reliance on -flax-vector-conversions in AVX intrinsics headers andRichard Smith2019-09-171-2/+2
| | | | | | corresponding tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372063 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove reliance on lax vector conversions from altivec.h in VSX mode.Richard Smith2019-09-171-19/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372061 91177308-0d34-0410-b5e6-96231b3b80d8
* Push lambda scope earlier when transforming lambda expressionNicholas Allegra2019-09-171-4/+4
| | | | | | | | Differential Revision: https://reviews.llvm.org/D66067 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372058 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules][Objective-C] Use complete decl from module when diagnosing missing ↵Bruno Cardoso Lopes2019-09-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | import Summary: Otherwise the definition (first found) for ObjCInterfaceDecl's might precede the module one, which will eventually lead to crash, since diagnoseMissingImport needs one coming from a module. This behavior changed after Richard's r342018, which started to look into the definition of ObjCInterfaceDecls. rdar://problem/49237144 Reviewers: rsmith, arphaman Subscribers: jkorous, dexonsmith, ributzka, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372039 91177308-0d34-0410-b5e6-96231b3b80d8
* do not emit -Wunused-macros warnings in -frewrite-includes mode (PR15614)Lubos Lunak2019-09-161-1/+2
| | | | | | | | | | | | -frewrite-includes calls PP.SetMacroExpansionOnlyInDirectives() to avoid macro expansions that are useless in that mode, but this can lead to -Wunused-macros false positives. As -frewrite-includes does not emit normal warnings, block -Wunused-macros too. Differential Revision: https://reviews.llvm.org/D65371 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372026 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Fix parsing/sema for function templates with declare simd.Alexey Bataev2019-09-161-1/+1
| | | | | | | | Need to return original declaration group with FunctionTemplateDecl, not the inner FunctionDecl, to correctly handle parsing of directives with the templates parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372011 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some definitions from Sema to Basic to fix shared libs buildErich Keane2019-09-162-71/+74
| | | | | | | | r371875 moved some functionality around to a Basic header file, but didn't move its definitions as well. This patch moves some things around so that shared library building can work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371985 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Fix OMPClauseReader::readClause() uninitialized variable warning. NFCI.Simon Pilgrim2019-09-151-1/+3
| | | | | | Fixes static analyzer uninitialized variable warning for the OMPClause - the function appears to cover all cases, but I've added an assertion to make sure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371934 91177308-0d34-0410-b5e6-96231b3b80d8
* [Diagnostics] Added silence note for -Wsizeof-array-div; suggest extra parensDavid Bolvansky2019-09-141-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371924 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Fix multiple bugs related to dependency file options: -M -MM -MD ↵Fangrui Song2019-09-142-32/+38
| | | | | | | | | | | -MMD -MT -MQ -M -o test.i => dependency file is test.d, not test.i -MM -o test.i => dependency file is test.d, not test.i -M -MMD => bogus warning -Wunused-command-line-argument -M MT dummy => -w not rendered git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371918 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Improve Clang::getDependencyFileName and its tests after rC371853Fangrui Song2019-09-141-1/+1
| | | | | | | The test file name metadata-with-dots.c is confusing because -MD and -MMD have nothing to do with metadata. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371917 91177308-0d34-0410-b5e6-96231b3b80d8
* [WebAssembly] Narrowing and widening SIMD opsThomas Lively2019-09-131-0/+57
| | | | | | | | | | | | | | | | Summary: Implements target-specific LLVM intrinsics and clang builtins for these new SIMD operations, as described at https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#integer-to-integer-narrowing. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67425 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371906 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-scan-deps] Fix for headers having the same name as a directoryAlex Lorenz2019-09-131-0/+3
| | | | | | | | | | | | Scan deps tool crashes when called on a C++ file, containing an include that has the same name as a directory. The tool crashes since it finds foo/dir and tries to read that as a file and fails. Patch by: kousikk (Kousik Kumar) Differential Revision: https://reviews.llvm.org/D67091 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371903 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP5.0]Add basic support for declare variant directive.Alexey Bataev2019-09-136-85/+428
| | | | | | | Added basic support for declare variant directive and its match clause with user context selector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371892 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Add overload writeFileAtomically(std::function Writer)Jan Korous2019-09-132-47/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D67424 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371890 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland r371785: Add -Wpoison-system-directories warningManoj Gupta2019-09-131-0/+7
| | | | | | | | | | | | | | | | | | | | When using clang as a cross-compiler, we should not use system headers to do the compilation. This CL adds support of a new warning flag -Wpoison-system-directories which emits warnings if --sysroot is set and headers from common host system location are used. By default the warning is disabled. The intention of the warning is to catch bad includes which are usually generated by third party build system not targeting cross-compilation. Such cases happen in Chrome OS when someone imports a new package or upgrade one to a newer version from upstream. This is reland of r371785 with a fix to test file. Patch by: denik (Denis Nikitin) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371878 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.Erich Keane2019-09-1322-858/+585
| | | | | | | | | | | | In order to enable future improvements to our attribute diagnostics, this moves info from ParsedAttr into CommonAttributeInfo, then makes this type the base of the *Attr and ParsedAttr types. Quite a bit of refactoring took place, including removing a bunch of redundant Spelling Index propogation. Differential Revision: https://reviews.llvm.org/D67368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371875 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][Typo Correction] Fix potential infite loop on ambiguity checksDavid Goldman2019-09-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a bug introduced in D62648, where Clang could infinite loop if it became stuck on a single TypoCorrection when it was supposed to be testing ambiguous corrections. Although not a common case, it could happen if there are multiple possible corrections with the same edit distance. The fix is simply to wipe the TypoExpr from the `TransformCache` so that the call to `TransformTypoExpr` doesn't use the `CachedEntry`. Reviewers: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67515 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371859 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Add support for formatting (some) lambdas with explicit ↵Nico Weber2019-09-132-3/+22
| | | | | | | | | | | | | | template parameters. This patch makes cases work where the lambda's template list doesn't contain any of + - ! ~ / % << | || && ^ == != >= <= ? : true false (see added FIXME). Ports r359967 to clang-format. Differential Revision: https://reviews.llvm.org/D67246 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371854 91177308-0d34-0410-b5e6-96231b3b80d8