summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Drop spurious break; NFCSven van Haastregt2018-03-271-1/+0
| | | | llvm-svn: 328626
* Move a ref-counted pointer instead of copying it. NFC.Alexander Kornienko2018-03-271-1/+1
| | | | llvm-svn: 328623
* Revert "[clang-format] Remove empty lines before }[;] // comment"Krasimir Georgiev2018-03-271-5/+1
| | | | | | | | | This reverts commit r327861. The empty line before namespaces is desired in some places. We need a better approach to handle this. llvm-svn: 328621
* [analyzer] LoopUnrolling: update the matched assignment operatorsPeter Szecsi2018-03-271-3/+1
| | | | | | | | | Extended the matched assignment operators when checking for bound changes in a body of the loop by using the freshly added isAssignmentOperator matcher. This covers all the (current) possible assignments, tests added as well. Differential Revision: https://reviews.llvm.org/D38921 llvm-svn: 328619
* [ASTMatchers] Add isAssignmentOperator matcherPeter Szecsi2018-03-271-0/+1
| | | | | | | | | | | Adding a matcher for BinaryOperator and cxxOperatorCallExpr to be able to decide whether it is any kind of assignment operator or not. This would be useful since allows us to easily detect assignments via matchers for static analysis (Tidy, SA) purposes. Differential Revision: https://reviews.llvm.org/D44893 llvm-svn: 328618
* [coroutines] Fix unused warning on result of co_yield.Eric Fiselier2018-03-271-1/+2
| | | | | | | This patch follows up on r328602, which fixed the spurious unused result warning for `co_await`. llvm-svn: 328607
* [coroutines] Fix invalid source range in co_await call expressions.Eric Fiselier2018-03-271-1/+6
| | | | | | | | | | | | | | | | | Summary: Currently an invalid source range is generated for the member call expressions of `co_await`. The end location of the call expression is the `co_await` token loc, while the start is the location of the operand. This causes crashes when the source range is used to produce diagnostics. This patch fixes the issues by using the expression location instead of the token location when building the member calls. Reviewers: GorNishanov, rsmith, vsk, aaron.ballman Reviewed By: vsk Subscribers: cfe-commits, modocache Differential Revision: https://reviews.llvm.org/D44915 llvm-svn: 328606
* Fix unused expression warning in co_await.Eric Fiselier2018-03-271-0/+3
| | | | | | | | | Previously, anytime the result of the resume expression in operator co_await was unused, a warning was generated. This patch fixes the issue by only generating the unused result warning if calling `await_resume()` would also generate a warning. llvm-svn: 328602
* [Edit, Rewrite] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2018-03-277-103/+138
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 328597
* [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-263-94/+134
| | | | | | other minor fixes (NFC). llvm-svn: 328584
* [MS] Fix late-parsed template infinite loop in eager instantiationReid Kleckner2018-03-262-2/+21
| | | | | | | | | | | | | | | | | | Summary: This fixes PR33561 and PR34185. Don't store pending template instantiations for late-parsed templates in the normal PendingInstantiations queue. Instead, use a separate list that will only be parsed and instantiated at end of TU when late template parsing actually works and doesn't infinite loop. Reviewers: rsmith, thakis, hans Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44846 llvm-svn: 328567
* [CodeGen] Mark fma as const for AndroidPirama Arumuga Nainar2018-03-261-2/+2
| | | | | | | | | | | | | | | Summary: r318093 sets fma, fmaf, fmal as const for Gnu and MSVC. Android also does not set errno for these functions. So mark these const for Android. Reviewers: spatel, efriedma, srhines, chh, enh Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D44852 llvm-svn: 328552
* [OPENMP] Codegen for declare target with link clause.Alexey Bataev2018-03-265-77/+174
| | | | | | | | If the link clause is used on the declare target directive, the object should be linked on target or target data directives, not during the codegen. Patch adds support for this clause. llvm-svn: 328544
* [SemaCXX] _Pragma("clang optimize off") not affecting lambda.Carlos Alberto Enciso2018-03-261-0/+4
| | | | | | | | | | Declaring "_Pragma("clang optimize off")" before the body of a function with a lambda leads to the lambda functions in the body not being affected. Differential Revision: https://reviews.llvm.org/D43821 llvm-svn: 328494
* [C++17] Fix class template argument deduction for default constructors ↵Zhihao Yuan2018-03-241-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | without an initializer Summary: As the title says, this makes following code compile: ``` template<typename> struct Foo {}; Foo() -> Foo<void>; Foo f; // ok ``` Thanks Nicolas Lesser for coining the fix. Reviewers: rsmith, lichray Reviewed By: rsmith, lichray Subscribers: lichray, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38216 llvm-svn: 328409
* [analyzer] Do not crash in CallEvent.getReturnType()George Karpenkov2018-03-241-3/+5
| | | | | | When the call expression is not available. llvm-svn: 328406
* [ODRHash] Support pointer and reference types.Richard Trieu2018-03-241-0/+18
| | | | llvm-svn: 328404
* [libFuzzer] Use OptForFuzzing attribute with -fsanitize=fuzzer.Matt Morehouse2018-03-231-0/+4
| | | | | | | | | | | | | | | | | | | Summary: Disables certain CMP optimizations to improve fuzzing signal under -O1 and -O2. Switches all fuzzer tests to -O2 except for a few leak tests where the leak is optimized out under -O2. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D44798 llvm-svn: 328384
* Change for an LLVM header file moveDavid Blaikie2018-03-231-1/+1
| | | | llvm-svn: 328380
* [CUDA] Fixed false error reporting in case of calling H->G->HD->D.Artem Belevich2018-03-231-3/+6
| | | | | | | | | | Launching a kernel from the host code does not generate code for the kernel itself. This fixes an issue with clang erroneously reporting an error for a HD->D call from within the kernel. Differential Revision: https://reviews.llvm.org/D44837 llvm-svn: 328362
* [HWASan] Port HWASan to Linux x86-64 (clang)Alex Shlyapnikov2018-03-232-2/+2
| | | | | | | | | | | | Summary: Porting HWASan to Linux x86-64, the third of the three patches, clang part. Reviewers: eugenis Subscribers: cryptoad, cfe-commits Differential Revision: https://reviews.llvm.org/D44745 llvm-svn: 328361
* [AMDGPU] Fix codegen for inline assemblyYaxun Liu2018-03-232-1/+14
| | | | | | | | Need to override convertConstraint to recognise amdgpu specific register names. Differential Revision: https://reviews.llvm.org/D44533 llvm-svn: 328359
* [AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU (CLANG)Tony Tye2018-03-231-1/+1
| | | | | | | | Add two additional implicit arguments for OpenCL for the AMDGPU target using the AMDHSA runtime to support device enqueue. Differential Revision: https://reviews.llvm.org/D44696 llvm-svn: 328350
* [AMDGPU] Remove use of OpenCL triple environment and replace with function ↵Tony Tye2018-03-231-0/+5
| | | | | | | | | | | attribute for AMDGPU (CLANG) - Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target. - Use a function attribute to communicate to the AMDGPU backend. Differential Revision: https://reviews.llvm.org/D43735 llvm-svn: 328347
* [vfs] Don't bail out after a missing -ivfsoverlay fileBen Langmuir2018-03-234-21/+9
| | | | | | | | | | | | | This make -ivfsoverlay behave more like other fatal errors (e.g. missing -include file) by skipping the missing file instead of bailing out of the whole compilation. This makes it possible for libclang to still provide some functionallity as well as to correctly produce the fatal error diagnostic (previously we lost the diagnostic in libclang since there was no TU to tie it to). rdar://33385423 llvm-svn: 328337
* Bring r328238 back with a fix.Rafael Espindola2018-03-231-0/+1
| | | | | | | | | | | | The issues was that we were setting hidden visibility if, when processing a hidden class, we found out that we needed to emit a reference to a vtable provided by the standard library. Original message: Set dso_local on vtables. llvm-svn: 328288
* Remove problematic PrettyStackTrace entry added in r328276Jordan Rose2018-03-231-5/+0
| | | | | | | I'm not sure /why/ this is causing issues for libclang, but it is. Unbreak the buildbots since it's already consumed an hour of my time. llvm-svn: 328286
* [analyzer] Trust _Nonnull annotations for system frameworkGeorge Karpenkov2018-03-234-34/+81
| | | | | | | | | | | Changes the analyzer to believe that methods annotated with _Nonnull from system frameworks indeed return non null objects. Local methods with such annotation are still distrusted. rdar://24291919 Differential Revision: https://reviews.llvm.org/D44341 llvm-svn: 328282
* [analyzer] Extend GCDAntipatternChecker to match group_enter/group_leave patternGeorge Karpenkov2018-03-231-43/+104
| | | | | | | | rdar://38480416 Differential Revision: https://reviews.llvm.org/D44653 llvm-svn: 328281
* [analyzer] [NFC] Move worklist implementation to WorkList.cppGeorge Karpenkov2018-03-233-230/+253
| | | | | | | | | | Current location is very confusing, especially because there is already WorkList.h, and other code in CoreEngine.cpp is not related to work list implementation. Differential Revision: https://reviews.llvm.org/D44759 llvm-svn: 328280
* [ARM] Add ARMv8.2-A FP16 vector intrinsicAbderrazek Zaafrani2018-03-231-20/+42
| | | | | | | | Putting back the code in commit r327189 that was reverted in r322737. The code is being committed in three stages and this one is the last stage: 1) r327455 fp16 feature flags, 2) r327836 pass half type or i16 based on FullFP16, and 3) the code here which the front-end fp16 vector intrinsic for ARM. Differential revision https://reviews.llvm.org/D43650 llvm-svn: 328277
* Sink PrettyDeclStackTrace down to the AST libraryJordan Rose2018-03-2310-39/+49
| | | | | | | ...and add some very basic stack trace entries for module building. This would have helped track down rdar://problem/38434694 sooner. llvm-svn: 328276
* Set dso_local on __ImageBase.Rafael Espindola2018-03-221-4/+6
| | | | llvm-svn: 328266
* [analyzer] Enable temporary object destructor inlining by default.Artem Dergachev2018-03-221-1/+1
| | | | | | | | | | | | When a temporary is constructed with a proper construction context, it should be safe to inline the destructor. We have added suppressions for some of the common false positives caused by such inlining, so there should be - and from my observations there indeed is - more benefit than harm from enabling destructor inlining. Differential Revision: https://reviews.llvm.org/D44721 llvm-svn: 328258
* [CFG] [analyzer] Add C++17-specific ctor-initializer construction contexts.Artem Dergachev2018-03-223-10/+29
| | | | | | | | | | CXXCtorInitializer-based constructors are also affected by the C++17 mandatory copy elision, like variable constructors and return value constructors. Extend r328248 to support those. Differential Revision: https://reviews.llvm.org/D44763 llvm-svn: 328255
* [analyzer] Remove an assertion that doesn't hold in C++17.Artem Dergachev2018-03-222-16/+42
| | | | | | | | | | | | Function return values can be constructed directly in variables or passed directly into return statements, without even an elidable copy in between. This is how the C++17 mandatory copy elision AST behaves. The behavior we'll have in such cases is the "old" behavior that we've had before we've implemented destructor inlining and proper lifetime extension support. Differential Revision: https://reviews.llvm.org/D44755 llvm-svn: 328253
* [CFG] [analyzer] NFC: Move construction context allocation into a helper method.Artem Dergachev2018-03-221-36/+19
| | | | | | | | Improve readability of ConstructionContext::createFromLayers(). Differential Revision: https://reviews.llvm.org/D44725 llvm-svn: 328249
* [CFG] [analyzer] Add C++17-specific variable and return construction contexts.Artem Dergachev2018-03-223-13/+60
| | | | | | | | | | | | | | | | | | | In C++17 copy elision is mandatory for variable and return value constructors (as long as it doesn't involve type conversion) which results in AST that does not contain elidable constructors in their usual places. In order to provide construction contexts in this scenario we need to cover more AST patterns. This patch makes the CFG prepared for these scenarios by: - Fork VariableConstructionContext and ReturnedValueConstructionContext into two different sub-classes (each) one of which indicates the C++17 case and contains a reference to an extra CXXBindTemporaryExpr. - Allow CFGCXXRecordTypedCall element to accept VariableConstructionContext and ReturnedValueConstructionContext as its context. Differential Revision: https://reviews.llvm.org/D44597 llvm-svn: 328248
* Revert "Set dso_local on vtables."Rafael Espindola2018-03-221-3/+2
| | | | | | | | This reverts commit r328238. Looks like it broke some buildbots. llvm-svn: 328242
* Set dso_local on vtables.Rafael Espindola2018-03-221-2/+3
| | | | llvm-svn: 328238
* Set dso_local on builtin functions.Rafael Espindola2018-03-221-7/+1
| | | | | | | | | | The difference between CreateRuntimeFunction and CreateBuiltinFunction is that CreateBuiltinFunction would not set dllimport or dso_local. To keep the current semantics, just forward to CreateRuntimeFunction with Local=true so it doesn't add dllimport. llvm-svn: 328224
* [clang-format] Fix ObjC style guesser to also iterate over child linesBen Hamilton2018-03-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When I wrote `ObjCHeaderStyleGuesser`, I incorrectly assumed the correct way to iterate over all tokens in `AnnotatedLine` was to iterate over the linked list tokens starting with `AnnotatedLine::First`. However, `AnnotatedLine` also contains a vector `AnnotedLine::Children` with child `AnnotedLine`s which have their own tokens which we need to iterate over. Because I didn't iterate over the tokens in the children lines, the ObjC style guesser would fail on syntax like: #define FOO ({ NSString *s = ... }) as the statement(s) inside { ... } are child lines. This fixes the bug and adds a test. I confirmed the test failed before the fix, and passed after the fix. Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak, Wizard Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44790 llvm-svn: 328220
* [OpenMP][Clang] Add call to global data sharing stack initialization on the ↵Gheorghe-Teodor Bercea2018-03-221-0/+5
| | | | | | | | | | | | | | | | workers side Summary: The workers also need to initialize the global stack. The call to the initialization function needs to happen after the kernel_init() function is called by the master. This ensures that the per-team data structures of the runtime have been initialized. Reviewers: ABataev, grokos, carlo.bertolli, caomhin Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D44749 llvm-svn: 328219
* clang-format: Narrow down raw string literal line break exception.Daniel Jasper2018-03-221-4/+4
| | | | | | | | | | | | For multiline raw string literals, we generally want to respect the author's choice of linebreak before the 'R"(' as the rest of the raw string might be aligned to it and we cannot (commonly) modify the content. For single-line raw string literals, this doesn't make any sense and so we should just treat them as regular string literals in this regard. llvm-svn: 328201
* clang-format: Fix SpacesInParentheses with fully qualified names.Daniel Jasper2018-03-221-1/+2
| | | | | | | | | | | When SpacesInParentheses is set to true clang-format does not add a space before fully qualified names. For example: do_something(::globalVar ); Fix by Darby Payne. Thank you! llvm-svn: 328200
* [CodeGen] Emit DWARF "constructor" calling conventionJonas Devlieghere2018-03-221-3/+11
| | | | | | | | | | | Now that LLVM has support for emitting calling conventions in DWARF (see r328191) have clang emit them. Patch by: Adrien Guinet Differential revision: https://reviews.llvm.org/D42351 llvm-svn: 328196
* [clang-format] Add a few more Core Graphics identifiers to ObjC heuristicBen Hamilton2018-03-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We received reports of the Objective-C style guesser getting a false negative on header files like: CGSize SizeOfThing(MyThing thing); This adds more Core Graphics identifiers to the Objective-C style guesser. Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: jolesiak, djasper Reviewed By: jolesiak, djasper Subscribers: krasimir, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44632 llvm-svn: 328175
* [clang-format] Don't insert space between r_paren and 'new' in ObjC declBen Hamilton2018-03-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, clang-format would insert a space between the closing parenthesis and 'new' in the following valid Objective-C declaration: + (instancetype)new; This was because 'new' is treated as a keyword, not an identifier. TokenAnnotator::spaceRequiredBefore() already handled the case where r_paren came before an identifier, so this diff extends it to handle r_paren before 'new'. Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak, stephanemoore Reviewed By: djasper, jolesiak, stephanemoore Subscribers: stephanemoore, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44692 llvm-svn: 328174
* Improve -Winfinite-recursionRobert Widmann2018-03-221-47/+24
| | | | | | | | | | | | | | Summary: Rewrites -Winfinite-recursion to remove the state dictionary and explore paths in loops - especially infinite loops. The new check now detects recursion in loop bodies dominated by a recursive call. Reviewers: rsmith, rtrieu Reviewed By: rtrieu Subscribers: lebedev.ri, cfe-commits Differential Revision: https://reviews.llvm.org/D43737 llvm-svn: 328173
* [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-224-195/+274
| | | | | | other minor fixes (NFC). llvm-svn: 328171
OpenPOWER on IntegriCloud