summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-format] Fix comment, NFCKrasimir Georgiev2018-08-131-1/+1
| | | | llvm-svn: 339573
* Summary:Add clang::reinitializes attributeMartin Bohme2018-08-134-0/+59
| | | | | | | | | | | | | | | | Summary: This is for use by clang-tidy's bugprone-use-after-move check -- see corresponding clang-tidy patch at https://reviews.llvm.org/D49910. Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49911 llvm-svn: 339569
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-1311-216/+540
| | | | | | | The number of loops associated with the OpenMP loop constructs should not be considered as the number loops to collapse. llvm-svn: 339568
* [ASTImporter] Improved import of friend templates.Balazs Keri2018-08-132-10/+123
| | | | | | | | | | | | | | | | | | | Summary: When importing a friend class template declaration, this declaration should not be merged with any other existing declaration for the same type. Otherwise the getFriendDecl of the FriendDecl can point to an other already referenced declaration, this case causes problems. Additionally the previous decl of class templates is set at import. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50516 llvm-svn: 339560
* Revert "Allow relockable scopes with thread safety attributes."Haojian Wu2018-08-132-216/+14
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r339456. The change introduces a new crash, see class SCOPED_LOCKABLE FileLock { public: explicit FileLock() EXCLUSIVE_LOCK_FUNCTION(file_); ~FileLock() UNLOCK_FUNCTION(file_); void Lock() EXCLUSIVE_LOCK_FUNCTION(file_); Mutex file_; }; void relockShared2() { FileLock file_lock; file_lock.Lock(); } llvm-svn: 339558
* [clang] Store code completion token range in preprocessor.Kadir Cetinkaya2018-08-132-0/+14
| | | | | | | | | | | | | | | | | Summary: This change is to support a new fature in clangd, tests will be send toclang-tools-extra with that change. Unittests are included in: https://reviews.llvm.org/D50449 Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50443 llvm-svn: 339540
* [ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExprShuai Wang2018-08-124-5/+49
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50605 llvm-svn: 339530
* Renaming arg_const_range to const_arg_range; NFC.Aaron Ballman2018-08-123-9/+9
| | | | | | This form makes more sense (it is a range over constant arguments) and is most consistent with const_arg_iterator (there are zero instances of arg_const_iterator). llvm-svn: 339527
* [ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExprShuai Wang2018-08-126-7/+74
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50606 llvm-svn: 339522
* [ASTImporter] Added test case for opaque enumsRaphael Isemann2018-08-112-1/+7
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50550 llvm-svn: 339506
* [ASTImporter] Added test case for CXXConversionDecl importingRaphael Isemann2018-08-112-0/+15
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50552 llvm-svn: 339505
* Make the section boundary checks on Windows not depend on the order as they ↵Douglas Yung2018-08-111-16/+16
| | | | | | are emitted in reverse when the compiler is built by Visual C++. llvm-svn: 339494
* [analyzer] Fix keyboard navigation for .msgNote eventsGeorge Karpenkov2018-08-111-1/+2
| | | | | | | | Does not go to msgNote's. Differential Revision: https://reviews.llvm.org/D50595 llvm-svn: 339493
* [analyzer] InnerPointerChecker: improve warning messages and notes.Reka Kovacs2018-08-104-135/+202
| | | | | | Differential Revision: https://reviews.llvm.org/D49570 llvm-svn: 339489
* [analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate ↵George Karpenkov2018-08-109-4313/+4330
| | | | | | | | | | files, use diff instead of a FileCheck - II Some files were missed by https://reviews.llvm.org/D50545 Differential Revision: https://reviews.llvm.org/D50590 llvm-svn: 339488
* [analyzer] Record nullability implications on getting items from NSDictionaryGeorge Karpenkov2018-08-103-15/+328
| | | | | | | | | | | | | | | | | | | | If we get an item from a dictionary, we know that the item is non-null if and only if the key is non-null. This patch is a rather hacky way to record this implication, because some logic needs to be duplicated from the solver. And yet, it's pretty simple, performant, and works. Other possible approaches: - Record the implication, in future rely on Z3 to pick it up. - Generalize the current code and move it to the constraint manager. rdar://34990742 Differential Revision: https://reviews.llvm.org/D50124 llvm-svn: 339482
* [analyzer] Fix tracking expressions through negation operatorGeorge Karpenkov2018-08-102-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D50537 llvm-svn: 339476
* [analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate ↵George Karpenkov2018-08-1052-63183/+67351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files, use diff instead of a FileCheck Some of the analyzer tests check the exact plist output, in order to verify that the diagnostics produced is correct. Current testing setup has many issues: plist output clobbers tests, making them harder to read it is impossible to debug test failures given error messages from FileCheck. The only recourse is manually creating the files and using the diff again, it is impossible to update the tests given the error message: the only process is a tedious manual one, going from a separate plist file to CHECK directives. This patch offers a much better approach of using "diff" directly in place of FileCheck, and moving tests to separate files. Generated using the following script: ``` import os import glob import re import subprocess diagnostics_key = "// CHECK: <key>diagnostics</key>" def process_file(f, data): idx = data.index(diagnostics_key) plist_out_f = 'ExpectedOutputs/plists/%s.plist' % f plist_out_folder = os.path.join('ExpectedOutputs/plists/', os.path.dirname(f)) plist_data = data[idx:] plist_data = plist_data.replace('// CHECK: ', '') plist_data = plist_data.replace('// CHECK-NEXT: ', '') plist_data += "</dict>\n</plist>\n" data = data[:idx] ptn = re.compile("FileCheck --?input-file(=| )(%t|%t\.plist) %s") if not ptn.findall(data): print "none found =/ skipping..." return data = ptn.sub(lambda m: "tail -n +11 %s | diff -u -w - %%S/../%s" % (m.group(2), plist_out_f), data) with open(f, 'w') as out_f: out_f.write(data) subprocess.check_call(["mkdir", "-p", plist_out_folder]) with open(plist_out_f, 'w') as out_f: out_f.write(plist_data) def main(): files = glob.glob("**/*.*") for f in files: with open(f) as f_handler: data = f_handler.read() if diagnostics_key in data: print "Converting %s" %f process_file(f, data) if __name__ == "__main__": main() ``` Differential Revision: https://reviews.llvm.org/D50545 llvm-svn: 339475
* Invalidate static locals when escaping lambdasGeorge Karpenkov2018-08-102-0/+57
| | | | | | | | | | Lambdas can affect static locals even without an explicit capture. rdar://39537031 Differential Revision: https://reviews.llvm.org/D50368 llvm-svn: 339459
* Allow relockable scopes with thread safety attributes.Aaron Ballman2018-08-102-14/+216
| | | | | | Patch by Aaron Puchert llvm-svn: 339456
* Make changes to the check strings so that the test I modified in r339438Akira Hatanaka2018-08-101-3/+3
| | | | | | passes on 32-bit targets. llvm-svn: 339452
* [CodeGen] Merge equivalent block copy/helper functions.Akira Hatanaka2018-08-1027-241/+560
| | | | | | | | | | | | | | | | | | | | | | | Clang generates copy and dispose helper functions for each block literal on the stack. Often these functions are equivalent for different blocks. This commit makes changes to merge equivalent copy and dispose helper functions and reduce code size. To enable merging equivalent copy/dispose functions, the captured object infomation is encoded into the helper function name. This allows IRGen to check whether an equivalent helper function has already been emitted and reuse the function instead of generating a new helper function whenever a block is defined. In addition, the helper functions are marked as linkonce_odr to enable merging helper functions that have the same name across translation units and marked as unnamed_addr to enable the linker's deduplication pass to merge functions that have different names but the same content. rdar://problem/42640608 Differential Revision: https://reviews.llvm.org/D50152 llvm-svn: 339438
* Fix a deprecated warning in the last commit.David Chisnall2018-08-101-1/+1
| | | | | | | Done as a separate commit to make it easier to cherry pick the changes to the release branch. llvm-svn: 339429
* Add Windows support for the GNUstep Objective-C ABI V2.David Chisnall2018-08-1014-179/+363
| | | | | | | | | | | | | | | | | | | | | Summary: Introduces funclet-based unwinding for Objective-C and fixes an issue where global blocks can't have their isa pointers initialised on Windows. After discussion with Dustin, this changes the name mangling of Objective-C types to prevent a C++ catch statement of type struct X* from catching an Objective-C object of type X*. Reviewers: rjmccall, DHowett-MSFT Reviewed By: rjmccall, DHowett-MSFT Subscribers: mgrang, mstorsjo, smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D50144 llvm-svn: 339428
* clang-cl: accept -fcrash-diagnostics-dir=Hans Wennborg2018-08-102-1/+2
| | | | llvm-svn: 339424
* Fix a wrong type bug in ParsedAttr::TypeTagForDatatypeDataBruno Ricci2018-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a wrong type bug inside ParsedAttr::TypeTagForDatatypeData. The details to the best of my knowledge are as follow. The incredible thing is that everything works out just fine by chance due to a sequence of lucky coincidences in the layout of various types. The struct ParsedAttr::TypeTagForDatatypeData contains among other things a ParsedType *MatchingCType, where ParsedType is just OpaquePtr<QualType>. However the member MatchingCType is initialized in the constructor for type_tag_for_datatype attribute as follows: new (&ExtraData.MatchingCType) ParsedType(matchingCType); This results in the ParsedType being constructed in the location of the ParsedType * Later ParsedAttr::getMatchingCType do return *getTypeTagForDatatypeDataSlot().MatchingCType; which instead of dereferencing the ParsedType * will dereference the QualType inside the ParsedType. Now this QualType in this case contains no qualifiers and therefore is a valid Type *. Therefore getMatchingCType returns a Type or at least the stuff that is in the first sizeof(void*) bytes of it, But it turns out that Type inherits from ExtQualsCommonBase and that the first member of ExtQualsCommonBase is a const Type *const BaseType. This Type * in this case points to the original Type pointed to by the QualType and so everything works fine even though all the types were wrong. This bug was only found because I changed the layout of Type, which obviously broke all of this long chain of improbable events. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D50532 llvm-svn: 339423
* clang-cl: Support /guard:cf,nochecksHans Wennborg2018-08-105-8/+43
| | | | | | | | | | This extension emits the guard cf table without inserting the instrumentation. Currently that's what clang-cl does with /guard:cf anyway, but this allows a user to request that explicitly. Differential Revision: https://reviews.llvm.org/D50513 llvm-svn: 339420
* Fix size calculation from r339380Richard Trieu2018-08-101-1/+1
| | | | | | | | | r339380 changed the trailing types of ParsedAttr to use llvm::TrailingObjects. However, it did not copy over one of the size attributes, causing a too small allocation for this object. The error was detected with AddressSanitizer use-after-poison llvm-svn: 339409
* Mark up deprecated methods as suchStephen Kelly2018-08-0921-328/+1312
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50352 llvm-svn: 339403
* Remove obsolete set callStephen Kelly2018-08-091-8/+0
| | | | | | | | | | | | | | Summary: Case case of the switch statement here makes the same call, but it is already done at the start of the function. Reviewers: rsmith, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50409 llvm-svn: 339402
* AMDGPU: Add another missing builtinMatt Arsenault2018-08-093-1/+10
| | | | llvm-svn: 339395
* Added LLVM metadata to generated IR to increase vectorization widthEmmett Neyman2018-08-091-1/+6
| | | | | | | | | | | | | | Summary: Edited `loop_proto_to_llvm` to emit metadata at the end of the generated IR. This metadata will increase the vector width when the IR is optimized. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50530 llvm-svn: 339392
* Fix and recommit r339382 based on solution from RSmith:Erich Keane2018-08-091-3/+1
| | | | | | | | | As sent on cfe-commits: "You need to use "friend TrailingObjects;" here, not "friend class TrailingObjects;", to avoid breaking MSVC (which doesn't implement injected-class-names quite according to spec)." llvm-svn: 339389
* Revert -r339382, which apparently breaks the Windows build.Erich Keane2018-08-091-1/+3
| | | | llvm-svn: 339387
* Port getLocEnd -> getEndLocStephen Kelly2018-08-0981-543/+515
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 llvm-svn: 339386
* Port getLocStart -> getBeginLocStephen Kelly2018-08-09147-2553/+2369
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* Port getStartLoc -> getBeginLocStephen Kelly2018-08-098-21/+21
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50349 llvm-svn: 339384
* [NFC] Complete the rule-of-5 for ParsedAttrErich Keane2018-08-091-0/+2
| | | | | | | Add move assign/construct as 'deleted' to ParsedAttr to complete the rule-of-5. llvm-svn: 339383
* [NFC] Simplify 'friend' declaration in ParsedAttrErich Keane2018-08-091-3/+1
| | | | | | | | As suggested in the post-commit review for D50531, change from the templatized TrailingObjects friend declaration to a version referring to the base. llvm-svn: 339382
* [NFC] Convert ParsedAttr to use llvm::TrailingObjectsErich Keane2018-08-093-68/+106
| | | | | | | | | | | ParsedAttr is using a hand-rolled trailing-objects implementation that gets cleaned up quite a bit by just using llvm::TrailingObjects. This is a large TrailingObjects list, but most things are length '0'. Differential Revision: https://reviews.llvm.org/D50531 llvm-svn: 339380
* Fix buildStephen Kelly2018-08-091-1/+1
| | | | llvm-svn: 339379
* [Sema] P0961R1: Relaxing the structured bindings customization point finding ↵Erik Pilkington2018-08-093-9/+87
| | | | | | | | rules Differential revision: https://reviews.llvm.org/D50418 llvm-svn: 339375
* Add getEndLoc API to replace getLocEndStephen Kelly2018-08-0923-175/+342
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50348 llvm-svn: 339374
* Add getBeginLoc API to replace getStartLocStephen Kelly2018-08-094-5/+7
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50347 llvm-svn: 339373
* Add getBeginLoc API to replace getLocStartStephen Kelly2018-08-0921-183/+342
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50346 llvm-svn: 339372
* [analyzer] Fix the bug in UninitializedObjectChecker caused by not handling ↵George Karpenkov2018-08-092-2/+25
| | | | | | | | block pointers Differential Revision: https://reviews.llvm.org/D50523 llvm-svn: 339369
* [AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c testsSjoerd Meijer2018-08-091-22/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D50175 llvm-svn: 339347
* Implement diagnostic stream operator for ParsedAttr.Erich Keane2018-08-097-291/+289
| | | | | | | | | | | | | As a part of attempting to clean up the way attributes are printed, this patch adds an operator << to the diagnostics/ partialdiagnostics so that ParsedAttr can be sent directly. This patch also rewrites a large amount* of the times when ParsedAttr was printed using its IdentifierInfo object instead of being printed itself. *"a large amount" == "All I could find". llvm-svn: 339344
* Fix structural inequivalency of forward EnumDeclGabor Marton2018-08-092-0/+62
| | | | | | | | | | | | | | Summary: Currently we consider one forward declared RecordDecl and another with a definition equal. We have to do the same in case of enums. Reviewers: a_sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50444 llvm-svn: 339336
* Add support for importing imaginary literalsGabor Marton2018-08-094-0/+27
| | | | | | | | | | Reviewers: a_sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50428 llvm-svn: 339334
OpenPOWER on IntegriCloud