summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-order content from InitListExprStephen Kelly2018-12-091-4/+4
| | | | | | | | | | | | | | Summary: This causes no change in the output of ast-dump-stmt.cpp due to the way child nodes are printed with a delay. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55398 llvm-svn: 348714
* Fix InitListExpr testStephen Kelly2018-12-091-6/+6
| | | | | | Wrong case of Check meant this has no effect. llvm-svn: 348713
* SourceManager: insert(make_pair(..)) -> try_emplace. NFCFangrui Song2018-12-091-5/+2
| | | | llvm-svn: 348709
* Convert some ObjC msgSends to runtime calls.Pete Cooper2018-12-0810-14/+245
| | | | | | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as alloc/allocWithZone instead of sending a message to those functions. This patch adds support for converting messages to alloc/allocWithZone to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed By: rjmccall https://reviews.llvm.org/D55349 llvm-svn: 348687
* Move diagnostic enums into Basic.Richard Trieu2018-12-0823-166/+342
| | | | | | | | | Move enums from */*Diagnostic.h to Basic/Diagnostic*.h. Basic/AllDiagnostics.h needs all the enums and moving the sources to Basic prevents a Basic->*->Basic dependency loop. This also allows each Basic/Diagnostics*Kinds.td to have a header at Basic/Diagnostic*.h (except for Common). The old headers are kept in place since other packages are still using them. llvm-svn: 348685
* Stop tracking retain count of OSObject after escape to void * / other ↵George Karpenkov2018-12-082-0/+30
| | | | | | | | | | | | | | primitive types Escaping to void * / uint64_t / others non-OSObject * should stop tracking, as such functions can have heterogeneous semantics depending on context, and can not always be annotated. rdar://46439133 Differential Revision: https://reviews.llvm.org/D55465 llvm-svn: 348675
* [tests] Fix the FileManagerTest getVirtualFile test on WindowsStella Stamenova2018-12-071-8/+20
| | | | | | | | | | | | Summary: The test passes on Windows only when it is executed on the C: drive. If the build and tests run on a different drive, the test is currently failing. Reviewers: kadircet, asmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55451 llvm-svn: 348665
* [CUDA] Added missing 'inline' for functions defined in a header.Artem Belevich2018-12-071-2/+4
| | | | llvm-svn: 348662
* [Preprocessor] Don't avoid entering included files after hitting a fatal error.Volodymyr Sapsai2018-12-075-5/+31
| | | | | | | | | | | | | | | | | | | | | | | Change in r337953 violated the contract for `CXTranslationUnit_KeepGoing`: > Do not stop processing when fatal errors are encountered. Use different approach to fix long processing times with multiple inclusion cycles. Instead of stopping preprocessing for fatal errors, do this after reaching the max allowed include depth and only for the files that were processed already. It is likely but not guaranteed those files cause a cycle. rdar://problem/46108547 Reviewers: erik.pilkington, arphaman Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, ilya-biryukov, Dmitry.Kozhevnikov Differential Revision: https://reviews.llvm.org/D55095 llvm-svn: 348641
* [analyzer] Move out tracking retain count for OSObjects into a separate checkerGeorge Karpenkov2018-12-077-88/+225
| | | | | | | | | Allow enabling and disabling tracking of ObjC/CF objects separately from tracking of OS objects. Differential Revision: https://reviews.llvm.org/D55400 llvm-svn: 348638
* [analyzer] RetainCountChecker: remove untested, unused, incorrect option ↵George Karpenkov2018-12-073-17/+7
| | | | | | | | | | | | IncludeAllocationLine The option has no tests, is not used anywhere, and is actually incorrect: it prints the line number without the reference to a file, which can be outright incorrect. Differential Revision: https://reviews.llvm.org/D55385 llvm-svn: 348637
* Make testcase more robust for bots actually building in /varAdrian Prantl2018-12-071-15/+15
| | | | llvm-svn: 348618
* [CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows botGabor Marton2018-12-071-2/+2
| | | | llvm-svn: 348614
* Adding an AST dump test for statement expressions; NFC.Aaron Ballman2018-12-071-0/+11
| | | | llvm-svn: 348613
* Make testcase more robust for completely-out-of-tree builds.Adrian Prantl2018-12-071-5/+9
| | | | | | Thats to Dave Zarzycki for reprorting this! llvm-svn: 348612
* [CTU] Add triple/lang mismatch handlingGabor Marton2018-12-076-1/+126
| | | | | | | | | | | | | | | | | | Summary: We introduce a strict policy for C++ CTU. It can work across TUs only if the C++ dialects are the same. We neither allow C vs C++ CTU. We do this because the same constructs might be represented with different properties in the corresponding AST nodes or even the nodes might be completely different (a struct will be RecordDecl in C, but it will be a CXXRectordDecl in C++, thus it may cause certain assertions during cast operations). Reviewers: xazax.hun, a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D55134 llvm-svn: 348610
* [CTU] test/Analysis/ctu-main.cpp Attempt to fix failing windows botGabor Marton2018-12-071-2/+2
| | | | llvm-svn: 348609
* [CTU] Add more lit tests and better error handlingGabor Marton2018-12-076-2/+126
| | | | | | | | | | | | | | | Summary: Adding some more CTU list tests. E.g. to check if a construct is unsupported. We also slightly modify the handling of the return value of the `Import` function from ASTImporter. Reviewers: xazax.hun, balazske, a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D55131 llvm-svn: 348605
* [unittests] Add C++17 and C++2a support to the tooling testsHamza Sood2018-12-071-0/+4
| | | | llvm-svn: 348603
* Make CPUDispatch resolver emit dependent functions.Erich Keane2018-12-073-3/+19
| | | | | | | | | | Inline cpu_specific versions referenced before the cpu_dispatch function weren't properly emitted, since they hadn't been referred to. This patch ensures that during resolver generation that all appropriate versions are emitted. Change-Id: I94c3766aaf9c75ca07a0ad8258efdbb834654ff8 llvm-svn: 348600
* Add an explicit triple to this test to prevent failures due to size_t ↵Aaron Ballman2018-12-071-3/+3
| | | | | | differences. llvm-svn: 348599
* Fix spelling of WINDOWS in a testErich Keane2018-12-071-1/+1
| | | | | Change-Id: I232515655359f14308e1c5509c4b7db96d1fafcb llvm-svn: 348598
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-12-071-2/+174
| | | | | | This adds tests for various statements in C++ that are not covered by C. llvm-svn: 348596
* Revert "Multiversioning- Ensure all MV functions are emitted."Erich Keane2018-12-074-60/+50
| | | | | | | | | This reverts commit 65df29f9318ac13a633c0ce13b2b0bccf06e79ca. AS suggested by @rsmith here: https://reviews.llvm.org/rL345839 I'm reverting this and solving the initial problem in a different way. llvm-svn: 348595
* [CTU] Add DisplayCTUProgress analyzer switchGabor Marton2018-12-076-8/+29
| | | | | | | | | | | | | | | | Summary: With a new switch we may be able to print to stderr if a new TU is being loaded during CTU. This is very important for higher level scripts (like CodeChecker) to be able to parse this output so they can create e.g. a zip file in case of a Clang crash which contains all the related TU files. Reviewers: xazax.hun, Szelethus, a_sidorin, george.karpenkov Subscribers: whisperity, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Differential Revision: https://reviews.llvm.org/D55135 llvm-svn: 348594
* [CodeComplete] Fix assertion failureIlya Biryukov2018-12-072-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ...that fires when running completion inside an argument of UnresolvedMemberExpr (see the added test). The assertion that fires is from Sema::TryObjectArgumentInitialization: assert(FromClassification.isLValue()); This happens because Sema::AddFunctionCandidates does not account for object types which are pointers. It ends up classifying them incorrectly. All usages of the function outside code completion are used to run overload resolution for operators. In those cases the object type being passed is always a non-pointer type, so it's not surprising the function did not expect a pointer in the object argument. However, code completion reuses the same function and calls it with the object argument coming from UnresolvedMemberExpr, which can be a pointer if the member expr is an arrow ('->') access. Extending AddFunctionCandidates to allow pointer object types does not seem too crazy since all the functions down the call chain can properly handle pointer object types if we properly classify the object argument as an l-value, i.e. the classification of the implicitly dereferenced pointer. Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55331 llvm-svn: 348590
* [unittests] Merge the PrintedStmtCXX..Matches functions (NFC)Hamza Sood2018-12-071-54/+49
| | | | | | This was reviewed as part of https://reviews.llvm.org/D36527 llvm-svn: 348589
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-12-071-5/+241
| | | | | | This adds tests for various statements in C. llvm-svn: 348588
* [CTU] Eliminate race condition in CTU lit testsGabor Marton2018-12-071-5/+12
| | | | | | | | | | | | | | | Summary: We plan to introduce additional CTU related lit test. Since lit may run the tests in parallel, it is not safe to use the same directory (%T) for these tests. It is safe to use however test case specific directories (%t). Reviewers: xazax.hun, a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D55129 llvm-svn: 348587
* [CTU] Add asserts to protect invariantsGabor Marton2018-12-071-0/+3
| | | | | | | | | | Reviewers: xazax.hun, a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D55132 llvm-svn: 348586
* [CTU] Add statisticsGabor Marton2018-12-071-1/+15
| | | | | | | | | | Reviewers: xazax.hun, a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Differential Revision: https://reviews.llvm.org/D55133 llvm-svn: 348584
* Add a AArch64 triple to tiny codemodel test.David Green2018-12-071-1/+1
| | | | | | Most other targets do not support the tiny code model. llvm-svn: 348582
* [PowerPC] VSX register support for inline assemblyKang Zhang2018-12-073-0/+52
| | | | | | | | | | | | Summary: The patch is to add the VSX register support for inline assembly. After this patch, we can use VSX register in inline assembly clobber list without error. Reviewed By: jsji, nemanjai Differential Revision: https://reviews.llvm.org/D55192 llvm-svn: 348572
* Fix thunks returning memptrs via sret by emitting also scalar return values ↵Hans Wennborg2018-12-073-5/+30
| | | | | | | | | | | | | | | | | | | directly in sret slot (PR39901) Thunks that return member pointers via sret are broken due to using temporary storage for the return value on the stack and then passing that pointer to a tail call, violating the rule that a tail call can't access allocas in the caller (see bug). Since r90526, we put aggregate return values directly in the sret slot, but this doesn't apply to member pointers which are considered scalar. Unless I'm missing something subtle, we should be able to always use the sret slot directly for indirect return values. Differential revision: https://reviews.llvm.org/D55371 llvm-svn: 348569
* Add test for InitListExprStephen Kelly2018-12-071-0/+18
| | | | llvm-svn: 348553
* NFC: Move VisitExpr code to dumpStmtStephen Kelly2018-12-061-89/+38
| | | | | | | | | | | | | | | | Summary: The call is duplicated in the handlers of all Expr subclasses. This change makes it easy to split statement handling out to TextNodeDumper. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55339 llvm-svn: 348546
* NFC: Move VisitStmt code to dumpStmtStephen Kelly2018-12-061-23/+6
| | | | | | | | | | | | Summary: This call is duplicated in Visits of all direct subclasses of Stmt. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55338 llvm-svn: 348545
* Add more expected content to match in testStephen Kelly2018-12-061-3/+3
| | | | llvm-svn: 348543
* Use relative line offsets in testStephen Kelly2018-12-061-12/+12
| | | | llvm-svn: 348541
* [frontend][darwin] warn_stdlibcxx_not_found: supress warning for ↵Alex Lorenz2018-12-062-1/+8
| | | | | | | | preprocessed input Addresses second post-commit feedback for r335081 from Nico llvm-svn: 348540
* [analyzer] Rely on os_consumes_this attribute to signify that the method ↵George Karpenkov2018-12-063-0/+23
| | | | | | | | call consumes a reference for "this" Differential Revision: https://reviews.llvm.org/D55158 llvm-svn: 348533
* [attributes] Add an attribute os_consumes_this, with similar semantics to ↵George Karpenkov2018-12-064-4/+30
| | | | | | | | | | | ns_consumes_self The attribute specifies that the call of the C++ method consumes a reference to "this". Differential Revision: https://reviews.llvm.org/D55155 llvm-svn: 348532
* [analyzer] Fix an infinite recursion bug while checking parent methods in ↵George Karpenkov2018-12-062-1/+13
| | | | | | | | RetainCountChecker Differential Revision: https://reviews.llvm.org/D55351 llvm-svn: 348531
* Allow forwarding -fdebug-compilation-dir to cc1asNico Weber2018-12-062-0/+9
| | | | | | | | | | | | | | | | | | | The flag -fdebug-compilation-dir is useful to make generated .o files independent of the path of the build directory, without making the compile command-line dependent on the path of the build directory, like -fdebug-prefix-map requires. This change makes it so that the driver can forward the flag to -cc1as, like it already can for -cc1. We might want to consider making -fdebug-compilation-dir a driver flag in a follow-up. (Since -fdebug-compilation-dir defaults to PWD, it's already possible to get this effect by setting PWD, but explicit compiler flags are better than env vars, because e.g. ninja tracks command lines and reruns commands that change.) Somewhat related to PR14625. Differential Revision: https://reviews.llvm.org/D55377 llvm-svn: 348515
* Reapply "Avoid emitting redundant or unusable directories in DIFile metadata ↵Adrian Prantl2018-12-065-22/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entries."" This reverts commit r348280 and reapplies D55085 without modifications. Original commit message: Avoid emitting redundant or unusable directories in DIFile metadata entries. As discussed on llvm-dev recently, Clang currently emits redundant directories in DIFile entries, such as .file 1 "/Volumes/Data/llvm" "/Volumes/Data/llvm/tools/clang/test/CodeGen/debug-info-abspath.c" This patch looks at any common prefix between the compilation directory and the (absolute) file path and strips the redundant part. More importantly it leaves the compilation directory empty if the two paths have no common prefix. After this patch the above entry is (assuming a compilation dir of "/Volumes/Data/llvm/_build"): .file 1 "/Volumes/Data/llvm" "tools/clang/test/CodeGen/debug-info-abspath.c" When building the FileCheck binary with debug info, this patch makes the build artifacts ~1kb smaller. Differential Revision: https://reviews.llvm.org/D55085 llvm-svn: 348513
* [CUDA] Fix nvidia-cuda-toolkit detection on UbuntuJoel E. Denny2018-12-061-1/+1
| | | | | | | | | | This just extends D40453 (r319317) to Ubuntu. Reviewed By: Hahnfeld, tra Differential Revision: https://reviews.llvm.org/D55269 llvm-svn: 348504
* [OPENMP][NVPTX] Fix globalization of the mapped array sections.Alexey Bataev2018-12-062-22/+57
| | | | | | | | | If the array section is based on pointer and this sections is mapped in target region + then it is used in the inner parallel region, it also must be globalized as the pointer itself is passed by value, not by reference. llvm-svn: 348492
* Diagnose friend function template redefinitions.Serge Pavlov2018-12-066-17/+121
| | | | | | | | | | | | | | Friend function template defined in a class template becomes available if the enclosing class template is instantiated. Until the function template is used, it does not have a body, but still is considered a definition for the purpose of redeclaration checks. This change modifies redefinition check so that it can find the friend function template definitions in instantiated classes. Differential Revision: http://reviews.llvm.org/D21508 llvm-svn: 348473
* Add test for ObjC genericsStephen Kelly2018-12-061-0/+8
| | | | llvm-svn: 348471
* Extend OMP testStephen Kelly2018-12-061-0/+7
| | | | llvm-svn: 348470
OpenPOWER on IntegriCloud