summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix for LLVM change (Transforms/Utils/Local.h -> Analysis/Utils/Local.h)David Blaikie2018-03-211-3/+3
| | | | llvm-svn: 328166
* [CUDA] Disable LTO for device-side compilations.Artem Belevich2018-03-212-5/+10
| | | | | | | | | | | | | | This fixes host-side LTO during CUDA compilation. Before, LTO pipeline construction was clashing with CUDA pipeline construction. At the moment there's no point doing LTO on device side as each device-side TU is a complete program. We will need to figure out compilation pipeline construction for the device-side LTO when we have working support for multi-TU device-side CUDA compilation. Differential Revision: https://reviews.llvm.org/D44691 llvm-svn: 328161
* [NVPTX] Make tensor shape part of WMMA intrinsic's name.Artem Belevich2018-03-211-23/+23
| | | | | | | | | | This is needed for the upcoming implementation of the new 8x32x16 and 32x8x16 variants of WMMA instructions introduced in CUDA 9.1. Differential Revision: https://reviews.llvm.org/D44719 llvm-svn: 328158
* [Modules] Fix creating fake definition data for lambdas.Volodymyr Sapsai2018-03-211-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During reading C++ definition data for lambda we can access CXXRecordDecl representing lambda before we finished reading the definition data. This can happen by reading a captured variable which is VarDecl, then reading its decl context which is CXXMethodDecl `operator()`, then trying to merge redeclarable methods and accessing enclosing CXXRecordDecl. The call stack looks roughly like VisitCXXRecordDecl ReadCXXRecordDefinition VisitVarDecl VisitCXXMethodDecl mergeRedeclarable getPrimaryContextForMerging If we add fake definition data at this point, later we'll hit the assertion Assertion failed: (!DD.IsLambda && !MergeDD.IsLambda && "faked up lambda definition?"), function MergeDefinitionData, file clang/lib/Serialization/ASTReaderDecl.cpp, line 1675. The fix is to assign definition data before reading it. Fixes PR32556. rdar://problem/37461072 Reviewers: rsmith, bruno Reviewed By: rsmith Subscribers: cfe-commits, jkorous-apple, aprantl Differential Revision: https://reviews.llvm.org/D43494 llvm-svn: 328153
* [Builtins] Overload __builtin_operator_new/delete to allow forwarding to ↵Eric Fiselier2018-03-216-28/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | usual allocation/deallocation functions. Summary: Libc++'s default allocator uses `__builtin_operator_new` and `__builtin_operator_delete` in order to allow the calls to new/delete to be ellided. However, libc++ now needs to support over-aligned types in the default allocator. In order to support this without disabling the existing optimization Clang needs to support calling the aligned new overloads from the builtins. See llvm.org/PR22634 for more information about the libc++ bug. This patch changes `__builtin_operator_new`/`__builtin_operator_delete` to call any usual `operator new`/`operator delete` function. It does this by performing overload resolution with the arguments passed to the builtin to determine which allocation function to call. If the selected function is not a usual allocation function a diagnostic is issued. One open issue is if the `align_val_t` overloads should be considered "usual" when `LangOpts::AlignedAllocation` is disabled. In order to allow libc++ to detect this new behavior the value for `__has_builtin(__builtin_operator_new)` has been updated to `201802`. Reviewers: rsmith, majnemer, aaron.ballman, erik.pilkington, bogner, ahatanak Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43047 llvm-svn: 328134
* Set dso_local on runtime variables.Rafael Espindola2018-03-211-1/+4
| | | | llvm-svn: 328068
* Revert r326782 "[analyzer] CStringChecker.cpp: Remove the duplicated check...".Artem Dergachev2018-03-211-0/+21
| | | | | | | It seems that the refactoring was causing a functional change and some warnings have disappeared. llvm-svn: 328067
* [analyzer] Suppress more MallocChecker positives in smart pointer destructors.Artem Dergachev2018-03-211-14/+39
| | | | | | | | | | | | | | | | | r326249 wasn't quite enough because we often run out of inlining stack depth limit and for that reason fail to see the atomics we're looking for. Add a more straightforward false positive suppression that is based on the name of the class. I.e. if we're releasing a pointer in a destructor of a "something shared/intrusive/reference/counting something ptr/pointer something", then any use-after-free or double-free that occurs later would likely be a false positive. rdar://problem/38013606 Differential Revision: https://reviews.llvm.org/D44281 llvm-svn: 328066
* [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-212-131/+153
| | | | | | other minor fixes (NFC). llvm-svn: 328063
* [Modules] Honor -fmodule-name when handling private framework modulesBruno Cardoso Lopes2018-03-203-12/+21
| | | | | | | | | | | | | | | | When skipping building the module for a private framework module, LangOpts.CurrentModule isn't enough for implict modules builds; for instance, in case a private module is built while building a public one, LangOpts.CurrentModule doesn't reflect the -fmodule-name being passed down, but instead the module name which triggered the build. Store the actual -fmodule-name in LangOpts.ModuleName and actually check a name was provided during compiler invocation in order to skip building the private module. rdar://problem/38434694 llvm-svn: 328053
* Delete BuiltinCC. NFC.Rafael Espindola2018-03-205-26/+3
| | | | | | It is always identical to RuntimeCC. llvm-svn: 328050
* [format] Eliminate global destructors.Benjamin Kramer2018-03-202-8/+7
| | | | llvm-svn: 328047
* [Driver] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-205-94/+110
| | | | | | other minor fixes (NFC). llvm-svn: 328044
* [format] Initialize regex lazilyBenjamin Kramer2018-03-201-8/+8
| | | | | | | No need to pay for this on program startup, and also no need to destroy it on process end. llvm-svn: 328041
* Set dso_local on string literals.Rafael Espindola2018-03-201-0/+1
| | | | llvm-svn: 328040
* [AArch64] Add vmulxh_lane fp16 vector intrinsicAbderrazek Zaafrani2018-03-201-0/+10
| | | | | | https://reviews.llvm.org/D44591 llvm-svn: 328038
* Set dso_local for runtime function.Rafael Espindola2018-03-201-0/+1
| | | | | | | This is another case where there is special logic for adding dllimport and so we cannot use setGVProperties. llvm-svn: 328036
* Basic: support PreserveMost and PreserveAll on Windows ARMSaleem Abdulrasool2018-03-201-0/+2
| | | | | | | Do not ignore these calling conventions on Windows ARM. They are used by the swift runtime for certain calls. llvm-svn: 328007
* [NVPTX] Make tensor load/store intrinsics overloaded.Artem Belevich2018-03-201-5/+3
| | | | | | | | | | | | | | | | This way we can support address-space specific variants without explicitly encoding the space in the name of the intrinsic. Less intrinsics to deal with -> less boilerplate. Added a bit of tablegen magic to match/replace an intrinsics with a pointer argument in particular address space with the space-specific instruction variant. Updated tests to use non-default address spaces. Differential Revision: https://reviews.llvm.org/D43268 llvm-svn: 328006
* Set dso_local for CFConstantStringClassReference.Rafael Espindola2018-03-201-7/+7
| | | | | | | This one cannot use setGVProperties since it has special logic for when it is dllimport or not. llvm-svn: 327993
* Set dso_local for guid decls.Rafael Espindola2018-03-201-0/+1
| | | | llvm-svn: 327991
* [OPENMP, NVPTX] Codegen for target distribute parallel combinedAlexey Bataev2018-03-201-8/+46
| | | | | | | | | | constructs in generic mode. Fixed codegen for distribute parallel combined constructs. We have to pass and read the shared lower and upper bound from the distribute region in the inner parallel region. Patch is for generic mode. llvm-svn: 327990
* [clang-format] Fix ObjC selectors with multiple params passed to macroBen Hamilton2018-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Objective-C selectors with arguments take the form of: foo: foo:bar: foo:bar:baz: These can be passed to a macro, like NS_SWIFT_NAME(): https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html and must never have spaces inserted around the colons. Previously, there was logic in TokenAnnotator's tok::colon parser to handle the single-argument case, but it failed for the multiple-argument cases. This diff fixes the bug and adds more tests. Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: jolesiak, djasper, Wizard Reviewed By: jolesiak, Wizard Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44638 llvm-svn: 327986
* [OPENMP, NVPTX] Globalization of the private redeclarations.Alexey Bataev2018-03-204-107/+195
| | | | | | | | If the generic codegen is enabled and private copy of the original variable escapes the declaration context, this private copy should be globalized just like it was the original variable. llvm-svn: 327985
* [analyzer] Fix the crash in IteratorChecker.cpp when 'SymbolConjured' has a ↵Henry Wong2018-03-201-1/+1
| | | | | | | | | | null Stmt. When the loop has a null terminator statement and sets 'widen-loops=true', 'invalidateRegions' will constructs the 'SymbolConjured' with null 'Stmt'. And this will lead to a crash in 'IteratorChecker.cpp'. This patch use 'dyn_cast_or_null<>' instead of 'dyn_cast<>' in IteratorChecker.cpp. Differential Revision: https://reviews.llvm.org/D44606 llvm-svn: 327962
* [ms] Parse #pragma optimize and ignore it behind its own flagHans Wennborg2018-03-201-0/+65
| | | | | | | | | This allows users to turn off warnings about this pragma specifically, while still receiving warnings about other ignored pragmas. Differential Revision: https://reviews.llvm.org/D44630 llvm-svn: 327959
* Properly construct `inline` members without initializersGeorge Burgess IV2018-03-201-1/+3
| | | | | | | | | | | | Digging through commit logs, it appears the checks in this block predate `inline` class variables. With them, we fail to emit dynamic initializers for members that don't have an explicit initializer, and we won't go out of our way to instantiate the class denoted by `Var->getType()`. Fixes PR35599. llvm-svn: 327945
* [CodeGen] Ignore OpaqueValueExprs that are unique references to theirAkira Hatanaka2018-03-208-54/+93
| | | | | | | | | | | | | | | | | | | | | | | | | source expressions when iterating over a PseudoObjectExpr's semantic subexpression list. Previously the loop in emitPseudoObjectExpr would emit the IR for each OpaqueValueExpr that was in a PseudoObjectExpr's semantic-form expression list and use the result when the OpaqueValueExpr later appeared in other expressions. This caused an assertion failure when AggExprEmitter tried to copy the result of an OpaqueValueExpr and the copied type didn't have trivial copy/move constructors or assignment operators. This patch adds flag IsUnique to OpaqueValueExpr which indicates it is a unique reference to its source expression (it is not used in multiple places). The loop in emitPseudoObjectExpr ignores OpaqueValueExprs that are unique and CodeGen visitors simply traverse the source expressions of such OpaqueValueExprs. rdar://problem/34363596 Differential Revision: https://reviews.llvm.org/D39562 llvm-svn: 327939
* [analyzer] Improve performance of NoStoreFuncVisitorGeorge Karpenkov2018-03-201-19/+50
| | | | | | | | Compute modifying frames lazily on demand. Differential Revision: https://reviews.llvm.org/D44503 llvm-svn: 327935
* [analyzer] Fix the assertion failure when static globals are used in lambda ↵George Karpenkov2018-03-201-15/+13
| | | | | | | | | | | | by reference Also use the opportunity to clean up the code and remove unnecessary duplication. rdar://37625895 Differential Revision: https://reviews.llvm.org/D44594 llvm-svn: 327926
* [CodeGen] Add funclet token to ARC markerShoaib Meenai2018-03-191-1/+1
| | | | | | | | | | | | | | | | The inline assembly generated for the ARC autorelease elision marker must have a funclet token if it's emitted inside a funclet, otherwise the inline assembly (and all subsequent code in the funclet) will be marked unreachable. r324689 fixed this issue for regular inline assembly blocks. Note that clang only emits the marker at -O0, so this only fixes that case. The optimizations case (where the marker is emitted by the backend) will be fixed in a separate change. Differential Revision: https://reviews.llvm.org/D44640 llvm-svn: 327892
* [OPENMP, NVPTX] Reworked castToType() function, NFC.Alexey Bataev2018-03-191-27/+34
| | | | | | | Reworked function castToType to use more frontend functionality rather than the backend. llvm-svn: 327873
* [ObjC] Allow declaring __weak pointer fields in C structs in ARC.Akira Hatanaka2018-03-1913-32/+131
| | | | | | | | | | | | | | | | | | | This patch uses the infrastructure added in r326307 for enabling non-trivial fields to be declared in C structs to allow __weak fields in C structs in ARC. This recommits r327206, which was reverted because it caused module-enabled builders to fail. I discovered that the CXXRecordDecl::CanPassInRegisters flag wasn't being set correctly in some cases after I moved it to RecordDecl. Thanks to Eric Liu for helping me investigate the bug. rdar://problem/33599681 https://reviews.llvm.org/D44095 llvm-svn: 327870
* [OPENMP] Fix build with MSVC, NFC.Alexey Bataev2018-03-191-2/+2
| | | | llvm-svn: 327868
* [OPENMP, NVPTX] Emit correct thread id.Alexey Bataev2018-03-192-28/+31
| | | | | | | We emitted fake thread id for the outined function in NVPTX codegen. Patch adds emission of the real thread id. llvm-svn: 327867
* [clang-format] Remove empty lines before }[;] // commentKrasimir Georgiev2018-03-191-1/+5
| | | | | | | | | | | | Summary: This addresses bug 36766 and a FIXME in tests about empty lines before `}[;] // comment` lines. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44631 llvm-svn: 327861
* [ARM] Pass half or i16 types for NEON intrinsicsSjoerd Meijer2018-03-195-20/+23
| | | | | | | | | | | | | | | For generating NEON intrinsics, this determines the NEON data type, and whether it should be a half type or an i16 type. I.e., we always pass a half type for AArch64, this hasn't changed, but now also for ARM but only when FullFP16 is enabled, and i16 otherwise. This is intended to be non-functional change, but together with the backend work in D44538 which adds support for f16 vectors, this enables adding the AArch32 FP16 (vector) intrinsics. Differential Revision: https://reviews.llvm.org/D44561 llvm-svn: 327836
* Resolve unused variable 'VR' warning in RetainCountChecker.cppBjorn Pettersson2018-03-181-1/+1
| | | | | | | | | Getting rid of error: unused variable 'VR' [-Werror,-Wunused-variable] warning/error at lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:1933 llvm-svn: 327802
* [C++17] Allow an empty expression in an if init statementZhihao Yuan2018-03-171-4/+18
| | | | | | | | | | | | | | | | | | | Summary: This fixes [PR35381](https://llvm.org/pr35381) and an additional bug where clang didn't warn about the C++17 extension when having an expression in the init statement. Thanks Nicolas Lesser for contributing the patch. Reviewers: rsmith Reviewed By: rsmith Subscribers: erik.pilkington, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D40445 llvm-svn: 327782
* Implement DR2229, which prohibits unnamed bit-fields from having qualifiers ↵Aaron Ballman2018-03-171-0/+7
| | | | | | in C++. llvm-svn: 327781
* Fix codegen for structured binding binding in conditionsZhihao Yuan2018-03-171-5/+5
| | | | | | | | | | | | | | | | | | | | | Summary: The codegen for conditions assumes that a normal variable declaration is used in a condition, but this is not the case when a structured binding is used. This fixes [PR36747](http://llvm.org/pr36747). Thanks Nicolas Lesser for contributing the patch. Reviewers: lichray, rsmith Reviewed By: lichray Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D44534 llvm-svn: 327780
* Adding nocf_check attribute for cf-protection fine tuningOren Ben Simhon2018-03-179-25/+64
| | | | | | | | | | The patch adds nocf_check target independent attribute for disabling checks that were enabled by cf-protection flag. The attribute can be appertained to functions and function pointers. Attribute name follows GCC's similar attribute name. Differential Revision: https://reviews.llvm.org/D41880 llvm-svn: 327768
* [MS] Fix bug in r327732 with devirtualized complete destructor callsReid Kleckner2018-03-161-0/+10
| | | | llvm-svn: 327754
* [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-162-202/+218
| | | | | | other minor fixes (NFC). llvm-svn: 327746
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-164-29/+29
| | | | | | | It is not needed after LLVM r327734. Now it will be easier to copy-paste IR symbol names from Clang. llvm-svn: 327738
* [Parser] Remove hard-coded bracket depth limitJan Korous2018-03-161-1/+1
| | | | | | The diagnostics produced if assert fails are using proper limit from language definition already. llvm-svn: 327735
* [MS] Always use base dtors in place of complete/vbase dtors when possibleReid Kleckner2018-03-165-26/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we tried too hard to uphold the fiction that destructor variants work like they do on Itanium throughout the ABI-neutral parts of clang. This lead to MS C++ ABI incompatiblities and other bugs. Now, -mconstructor-aliases will no longer control this ABI detail, and clang -cc1's LLVM IR output will be this much closer to the clang driver's. Based on a patch by Zahira Ammarguellat: https://reviews.llvm.org/D39063 I've tried to move the logic that Zahira added into MicrosoftCXXABI.cpp. There is only one ABI-specific detail sticking out, and that is in CodeGenModule::getAddrOfCXXStructor, where we collapse complete dtors to base dtors in the MS ABI. This fixes PR32990. Reviewers: erichkeane, zahiraam, majnemer, rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44505 llvm-svn: 327732
* [analyzer] Fix crashes in RetainCountChecker when underlying region is not a varGeorge Karpenkov2018-03-161-8/+12
| | | | | | | | | | | | For other regions, the error message contains a good indication of the problem, and there, in general, nothing helpful we can print. Error pointer to the problematic expression seems enough. rdar://37323555 Differential Revision: https://reviews.llvm.org/D44409 llvm-svn: 327727
* [clang-format] Disallow breaks before ']' in text proto extensionsKrasimir Georgiev2018-03-161-0/+3
| | | | | | | | | | Summary: This disallows patterns like `[ext.name\n]` in text protos. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44569 llvm-svn: 327716
* [clang-format] Fix raw string prefix penaltyKrasimir Georgiev2018-03-161-1/+7
| | | | | | | | | | Summary: We weren't penalizing cases where the raw string prefix goes over the column limit. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44563 llvm-svn: 327708
OpenPOWER on IntegriCloud