summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build bot after r340598.Eric Liu2018-08-241-8/+12
| | | | | | | Revert to the original behavior: only calculate real file path when file is opened and avoid using InterndPath for real path calculation. llvm-svn: 340602
* [Tooling] Add a isSingleProcess() helper to ToolExecutorIlya Biryukov2018-08-244-0/+13
| | | | | | | | | | | | | | | | Summary: Used in clangd's symbol builder to optimize for the common shared-memory executor case. Reviewers: ioeric Reviewed By: ioeric Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51164 llvm-svn: 340599
* [FileManager] Do not call 'real_path' in getFile().Eric Liu2018-08-241-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This partially rolls back the change in D48903: https://github.com/llvm-mirror/clang/commit/89aa7f45a1f728144935289d4ce69d8522999de0#diff-0025af005307891b5429b6a834823d5eR318 `real_path` can be very expensive on real file systems, and calling it on each opened file can slow down the compilation. This also slows down deserialized ASTs for which real paths need to be recalculated for each input files again. For clangd code completion latency (using preamble): Before {F7039629} After {F7039630} Reviewers: ilya-biryukov, simark Reviewed By: ilya-biryukov Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51159 llvm-svn: 340598
* [AVR] Fix inline asm calls now that the addrspace(0) there is explicit.Chandler Carruth2018-08-241-24/+24
| | | | | | | This updates the test case for r340519 so it should pass again. r340522 only got some of the AVR tests that needed an update. llvm-svn: 340596
* [RISCV] RISC-V using -fuse-init-array by defaultKito Cheng2018-08-242-1/+7
| | | | | | | | | | Reviewers: asb, apazos, mgrang Reviewed By: asb Differential Revision: https://reviews.llvm.org/D50043 llvm-svn: 340595
* Fix typoStephen Kelly2018-08-231-1/+1
| | | | llvm-svn: 340586
* Remove more const_casts by using ConstStmtVisitor [NFC]Aaron Puchert2018-08-231-32/+32
| | | | | | Again, this required adding some const specifiers. llvm-svn: 340580
* Revert r340552, "Driver: Enable address-significance tables by default when ↵Peter Collingbourne2018-08-232-3/+1
| | | | | | | | | targeting COFF." Received multiple reports of breakage due to undefined symbols suspected to be caused by this change. llvm-svn: 340579
* Remove unnecessary const_cast [NFC]Aaron Puchert2018-08-231-7/+7
| | | | | | | | This required adding a few const specifiers on functions. Also a minor formatting fix suggested in D49885. llvm-svn: 340575
* [docs] Regenerate ClangCommandLineReference.rstVedant Kumar2018-08-231-96/+192
| | | | llvm-svn: 340559
* [options] Document -(static|shared)-libsanVedant Kumar2018-08-231-2/+4
| | | | llvm-svn: 340558
* Driver: Enable address-significance tables by default when targeting COFF.Peter Collingbourne2018-08-232-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D51049 llvm-svn: 340552
* [ASTMatchers] Let hasObjectExpression also support UnresolvedMemberExpr, ↵Shuai Wang2018-08-233-2/+59
| | | | | | | | | | | | CXXDependentScopeMemberExpr Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50617 llvm-svn: 340547
* Re-land [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmtRaphael Isemann2018-08-232-0/+71
| | | | | | | Lands r340468 again, but this time we mark the test as unsupported on Windows because it seems that try/catch crashes CodeGen at the moment. llvm-svn: 340541
* [analyzer] added cache for SMT queries in the SMTConstraintManagerMikhail R. Gadelha2018-08-231-24/+30
| | | | | | | | | | | | | | | | | | | Summary: This patch implements a new cache for the result of SMT queries; with this patch the regression tests are 25% faster. It's implemented as a `llvm::DenseMap` where the key is the hash of the set of the constraints in a state. There is still one method that does not use the cache, `getSymVal`, because it needs to get a symbol interpretation from the SMT, which is not cached yet. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D50773 llvm-svn: 340535
* [analyzer] Moved all CSA code from the SMT API to a new header, `SMTConv.h`. ↵Mikhail R. Gadelha2018-08-235-731/+804
| | | | | | | | | | | | | | | | | | | | | NFC. Summary: With this patch, the SMT backend is almost completely detached from the CSA. Unfortunate consequence is that we missed the `ConditionTruthVal` from the CSA and had to use `Optional<bool>`. The Z3 solver implementation is still in the same file as the `Z3ConstraintManager`, in `lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp` though, but except for that, the SMT API can be moved to anywhere in the codebase. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D50772 llvm-svn: 340534
* [analyzer] Templatefy SMTConstraintManager so more generic code can be moved ↵Mikhail R. Gadelha2018-08-234-249/+206
| | | | | | | | | | | | | | | | | | | from solver specific implementations. NFC. Summary: By making SMTConstraintManager a template and passing the SMT constraint type and expr, we can further move code from the Z3ConstraintManager class to the generic SMT constraint Manager. Now, each SMT specific constraint manager only needs to implement the method `bool canReasonAbout(SVal X) const`. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Subscribers: mgorny, xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D50770 llvm-svn: 340533
* [analyzer] Delete SMTContext. NFC.Mikhail R. Gadelha2018-08-232-34/+2
| | | | | | | | | | | | | | Summary: There is no reason to have a base class for a context anymore as each SMT object carries a reference to the specific solver context. Reviewers: NoQ, george.karpenkov, hiraditya Reviewed By: hiraditya Subscribers: hiraditya, xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D50768 llvm-svn: 340532
* Change dyn_cast<CXXMethodDecl>(FD) to isa<CXXMethodDecl>(FD) [NFC]Mikael Holmen2018-08-231-1/+1
| | | | | | The result of the dyn_cast wasn't used to we can just check isa. llvm-svn: 340531
* Removed unused variable [NFC]Mikael Holmen2018-08-231-1/+1
| | | | | | | | | | The compiler warned: ../tools/clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp:329:19: error: unused variable 'MD' [-Werror,-Wunused-variable] if (const auto *MD = dyn_cast<CXXMethodDecl>(FD)) { ^ 1 error generated. llvm-svn: 340524
* Update avr attributes test for output change in r340519Alexander Richardson2018-08-232-2/+2
| | | | | | | | After this commit there is an addrspace(1) before the attribute #. Since these tests are only checking the value of the attribute add a {{.*}} to make the test resilient to future output changes. llvm-svn: 340522
* [libclang] Fix cursors for arguments of Subscript and Call operatorsIvan Donchevskii2018-08-232-1/+215
| | | | | | | | | | | | | | | | | | The DeclRefExpr of CXXOperatorCallExpr refering to the custom operator is visited before the arguments to the operator call. For the Call and Subscript operator the range of this DeclRefExpr includes the whole call expression, so that all tokens in that range were mapped to the operator function, even the tokens of the arguments. Fix this by ensuring that this particular DeclRefExpr is visited last. Fixes PR25775. Fix by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40481 llvm-svn: 340521
* [x86/retpoline] Split the LLVM concept of retpolines into separateChandler Carruth2018-08-235-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subtarget features for indirect calls and indirect branches. This is in preparation for enabling *only* the call retpolines when using speculative load hardening. I've continued to use subtarget features for now as they continue to seem the best fit given the lack of other retpoline like constructs so far. The LLVM side is pretty simple. I'd like to eventually get rid of the old feature, but not sure what backwards compatibility issues that will cause. This does remove the "implies" from requesting an external thunk. This always seemed somewhat questionable and is now clearly not desirable -- you specify a thunk the same way no matter which set of things are getting retpolines. I really want to keep this nicely isolated from end users and just an LLVM implementation detail, so I've moved the `-mretpoline` flag in Clang to no longer rely on a specific subtarget feature by that name and instead to be directly handled. In some ways this is simpler, but in order to preserve existing behavior I've had to add some fallback code so that users who relied on merely passing -mretpoline-external-thunk continue to get the same behavior. We should eventually remove this I suspect (we have never tested that it works!) but I've not done that in this patch. Differential Revision: https://reviews.llvm.org/D51150 llvm-svn: 340515
* Missing quote in previous commitJF Bastien2018-08-231-1/+1
| | | | | | The test was failing because I missed a quote. llvm-svn: 340511
* Improve incompatible triple errorJF Bastien2018-08-231-1/+1
| | | | | | When complaining that the triple is incompatible with all targets, print out the triple not just a generic error about triples not matching. llvm-svn: 340510
* [analyzer] Preliminary version of retain count checking for OSObjectsGeorge Karpenkov2018-08-236-24/+279
| | | | | | | | Has quite a lot of false positives, disabled behind the flag. Differential Revision: https://reviews.llvm.org/D50880 llvm-svn: 340502
* Revert "[CStringSyntaxChecker] Check strlcat sizeof check"George Karpenkov2018-08-232-67/+4
| | | | | | | | This reverts commit 3073790e87378fea9a68fb052185fec9596ef135. The check is not correct, strlact(dest, "mystr", sizeof(dest)) is fine. llvm-svn: 340501
* Revert "[CStringSyntaxChecker] Reduces space around error message for strlcat."George Karpenkov2018-08-232-2/+2
| | | | | | This reverts commit 6b43b80320722da41ca6ef7a3b57cc300fb83094. llvm-svn: 340500
* win: Omit ".exe" from clang and clang-cl driver-level diagnostics.Nico Weber2018-08-221-3/+3
| | | | | | | Like https://reviews.llvm.org/D51133 but for clang. https://reviews.llvm.org/D51134 llvm-svn: 340498
* Revert "[ASTImporter] Add test for ↵Raphael Isemann2018-08-222-68/+0
| | | | | | | | ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt" This test breaks llvm-clang-x86_64-expensive-checks-win. llvm-svn: 340483
* [NFC] Add tags file to .gitignoreGeorge Karpenkov2018-08-221-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D50109 llvm-svn: 340479
* [analyzer] Track non-zero values in ReturnVisitorGeorge Karpenkov2018-08-223-28/+52
| | | | | | | | | | | | | Tracking those can help to provide much better diagnostics in many cases. In general, most of the visitor machinery should be refactored to allow tracking the origin of arbitrary values. rdar://36039765 Differential Revision: https://reviews.llvm.org/D51131 llvm-svn: 340475
* [analyzer] Track the problematic subexpression in UndefResultCheckerGeorge Karpenkov2018-08-221-0/+4
| | | | | | | | This is tested in a subsequent commit, which allows tracking those values. Differential Revision: https://reviews.llvm.org/D51139 llvm-svn: 340474
* [analyzer] [NFC] Minor refactoring of BugReporterVisitorsGeorge Karpenkov2018-08-221-15/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D51130 llvm-svn: 340473
* [Driver] Check normalized triples for multiarch runtime pathPetr Hosek2018-08-2214-7/+23
| | | | | | | | | | | | | | | | | | | | Previously we only used target triple as provided which matches the GCC behavior, but it also means that all clients have to be consistent in their spelling of target triples since e.g. x86_64-linux-gnu and x86_64-unknown-linux-gnu will result in Clang driver looking at two different paths when searching for runtime libraries. Unfortunatelly, as it turned out many clients aren't consistent in their spelling of target triples, e.g. many Linux distributions use the shorter spelling but config.guess and rustc insist on using the normalized variant which is causing issues. To avoid having to ship multiple copies of runtimes for different triple spelling or rely on symlinks which are not portable, we should also check the normalized triple when constructing paths for multiarch runtimes. Differential Revision: https://reviews.llvm.org/D50547 llvm-svn: 340471
* [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmtRaphael Isemann2018-08-222-0/+68
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51121 llvm-svn: 340468
* [ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.Raphael Isemann2018-08-222-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs. This is because we import the `S` struct into the `test.cpp` context and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to import is generated by clang directly in the target context. This means we actually never test the importing of ArrayInitLoopExpr with this test, which becomes obvious when looking at the missing test coverage for the respective VisitArrayInitLoopExpr method. This patch moves the copy-assignment of our struct to the `S.cpp` context, which means that `test.cpp` now actually has to import the ArrayInitLoopExpr. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51115 llvm-svn: 340467
* [ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code.Raphael Isemann2018-08-221-32/+0
| | | | | | | | | | | | | | | | | | Summary: `CXXNamedCastExpr` importing is already handled in the respective `VisitCXXNamedCastExpr` method. So this code here can never be reached under normal circumstances and we might as well remove it. This patch shouldn't change any observable behavior of the ASTImporter. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51110 llvm-svn: 340466
* [ASTImporter] Add test for ObjCTypeParamDeclRaphael Isemann2018-08-222-0/+16
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51059 llvm-svn: 340465
* [ASTImporter] Add test for SwitchStmtRaphael Isemann2018-08-222-0/+65
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51056 llvm-svn: 340464
* [ASTImporter] Add test for ObjCAutoreleasePoolStmtRaphael Isemann2018-08-222-0/+14
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51123 llvm-svn: 340463
* Thread safety analysis: Allow relockable scopesAaron Puchert2018-08-222-2/+192
| | | | | | | | | | | | | | | | | | | Summary: It's already allowed to prematurely release a scoped lock, now we also allow relocking it again, possibly even in another mode. This is the second attempt, the first had been merged as r339456 and reverted in r339558 because it caused a crash. Reviewers: delesley, aaron.ballman Reviewed By: delesley, aaron.ballman Subscribers: hokein, cfe-commits Differential Revision: https://reviews.llvm.org/D49885 llvm-svn: 340459
* [NFC] Test commitAaron Puchert2018-08-221-2/+2
| | | | llvm-svn: 340452
* Currently clang does not emit unused static constants. GCC emits theseElizabeth Andrews2018-08-226-1/+27
| | | | | | | | | | | | | | | | constants by default when there is no optimization. GCC's option -fno-keep-static-consts can be used to not emit unused static constants. In Clang, since default behavior does not keep unused static constants, -fkeep-static-consts can be used to emit these if required. This could be useful for producing identification strings like SVN identifiers inside the object file even though the string isn't used by the program. Differential Revision: https://reviews.llvm.org/D40925 llvm-svn: 340439
* [Android] Default to -fno-math-errnoPirama Arumuga Nainar2018-08-223-0/+9
| | | | | | | | | | | | Summary: Android's libm does not set errno. Reviewers: srhines, enh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51068 llvm-svn: 340424
* [Tooling] Allow -flto flags and filter out -Wa, flagsChih-Hung Hsieh2018-08-222-6/+17
| | | | | | | | | | | | | This change fixes the problem in https://bugs.llvm.org/show_bug.cgi?id=38332 by allowing driver::Action::BackendJobClass to run with the analyzer. Otherwise, such jobs will look up the non-existing compilation database and then run without flags. Also filter out the -Wa,* flags that could be passed to and ignored by the clang compiler. Clang-tidy gives warnings about unused -Wa,* flags. Differential Revision: http://reviews.llvm.org/D51002 llvm-svn: 340421
* [CodeGen] Look at the type of a block capture field rather than the typeAkira Hatanaka2018-08-223-39/+98
| | | | | | | | | | | | | | of the captured variable when determining whether the capture needs special handing when the block is copied or disposed. This fixes bugs in the handling of variables captured by a block that is nested inside a lambda that captures the variables by reference. rdar://problem/43540889 Differential Revision: https://reviews.llvm.org/D51025 llvm-svn: 340408
* [analyzer] Improve `CallDescription` to handle c++ method.Henry Wong2018-08-223-52/+85
| | | | | | | | | | | | | | | | | Summary: `CallDecription` can only handle function for the time being. If we want to match c++ method, we can only use method name to match and can't improve the matching accuracy through the qualifiers. This patch add the support for `QualifiedName` matching to improve the matching accuracy. Reviewers: xazax.hun, NoQ, george.karpenkov, rnkovacs Reviewed By: xazax.hun, NoQ, rnkovacs Subscribers: Szelethus, szepet, rnkovacs, a.sidorin, mikhail.ramalho, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D48027 llvm-svn: 340407
* [Preamble] Fix an undefined behavior when checking an empty preamble can be ↵Haojian Wu2018-08-221-2/+2
| | | | | | | | | | | | | | | | reused. Summary: Passing nullptr to memcmp is UB. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50967 llvm-svn: 340403
* Fix import of class templates partial specializationGabor Marton2018-08-224-26/+355
| | | | | | | | | | | | | | | | | | | Summary: Currently there are several issues with the import of class template specializations. (1) Different TUs may have class template specializations with the same template arguments, but with different set of instantiated MethodDecls and FieldDecls. In this patch we provide a fix to merge these methods and fields. (2) Currently, we search the partial template specializations in the set of simple specializations and we add partial specializations as simple specializations. This is bad, this patch fixes it. Reviewers: a_sidorin, xazax.hun, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50451 llvm-svn: 340402
OpenPOWER on IntegriCloud