summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ThreadSafetyCommon.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Refactor representation of materialized temporariesTyker2019-11-191-2/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* Revert "[NFC] Refactor representation of materialized temporaries"Nico Weber2019-11-171-1/+2
| | | | | | This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, see comments on https://reviews.llvm.org/D69360
* [NFC] Refactor representation of materialized temporariesTyker2019-11-161-2/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* Thread Safety: also look at ObjC methodsJF Bastien2019-03-251-8/+13
| | | | | | | | | | | | | | | | | Summary: SExprBuilder::translateDeclRefExpr was only looking at FunctionDecl and not also looking at ObjCMethodDecl. It should consider both because the attributes can be used on Objective-C as well. <rdar://problem/48941331> Reviewers: dexonsmith, erik.pilkington Subscribers: jkorous, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59523 llvm-svn: 356940
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr.Bruno Ricci2018-12-211-1/+2
| | | | | | | | | All of the other constructors already take a reference to the AST context. This avoids calling Decl::getASTContext in most cases. Additionally move the definition of the constructor from Expr.h to Expr.cpp since it is calling DeclRefExpr::computeDependence. NFC. llvm-svn: 349901
* Create ConstantExpr classBill Wendling2018-10-311-0/+2
| | | | | | | | | | | | | | | | A ConstantExpr class represents a full expression that's in a context where a constant expression is required. This class reflects the path the evaluator took to reach the expression rather than the syntactic context in which the expression occurs. In the future, the class will be expanded to cache the result of the evaluated expression so that it's not needlessly re-evaluated Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D53475 llvm-svn: 345692
* Thread safety analysis: Make printSCFG compile again [NFC]Aaron Puchert2018-09-211-0/+13
| | | | | | | | | Not used productively, so no observable functional change. Note that printSCFG doesn't yet work reliably, it seems to crash sometimes. llvm-svn: 342790
* Thread safety analysis: Handle ObjCIvarRefExpr in SExprBuilder::translateAaron Puchert2018-09-191-3/+18
| | | | | | | | | | | | | | | | | Summary: This imitates the code for MemberExpr. Fixes PR38896. Reviewers: aaron.ballman, delesley, lukasza, rjmccall Reviewed By: delesley Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52200 llvm-svn: 342600
* Thread safety analysis: Fix crash for function pointersAaron Puchert2018-09-191-9/+11
| | | | | | | | For function pointers, the FunctionDecl of the callee is unknown, so getDirectCallee will return nullptr. We have to catch that case to avoid crashing. We assume there is no attribute then. llvm-svn: 342519
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Fix typos in clangAlexander Kornienko2018-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-131-49/+50
| | | | | | other minor fixes (NFC). llvm-svn: 327453
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-4/+4
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.Richard Smith2017-12-141-0/+1
| | | | | | | | | | | | | | | Adding the new enumerator forced a bunch more changes into this patch than I would have liked. The -Wtautological-compare warning was extended to properly check the new comparison operator, clang-format needed updating because it uses precedence levels as weights for determining where to break lines (and several operators increased their precedence levels with this change), thread-safety analysis needed changes to build its own IL properly for the new operator. All "real" semantic checking for this operator has been deferred to a future patch. For now, we use the relational comparison rules and arbitrarily give the builtin form of the operator a return type of 'void'. llvm-svn: 320707
* [CSA] [NFC] Move AnalysisContext.h to AnalysisDeclContext.hGeorge Karpenkov2017-09-061-1/+1
| | | | | | | | | | | | | | The implementation is in AnalysisDeclContext.cpp and the class is called AnalysisDeclContext. Making those match up has numerous benefits, including: - Easier jump from header to/from implementation. - Easily identify filename from class. Differential Revision: https://reviews.llvm.org/D37500 llvm-svn: 312671
* DR616, and part of P0135R1: member access (or pointer-to-member access) on aRichard Smith2016-12-031-0/+3
| | | | | | | temporary produces an xvalue, not a prvalue. Support this by materializing the temporary prior to performing the member access. llvm-svn: 288563
* [NFC] Header cleanupMehdi Amini2016-07-181-6/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [coroutines] Creation of promise object, lookup of operator co_await, buildingRichard Smith2015-10-271-0/+1
| | | | | | of await_* calls, and AST representation for same. llvm-svn: 251387
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-44/+3
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Thread Safety Analysis: fix before/after checks so that they work on globalDeLesley Hutchins2015-09-291-1/+1
| | | | | | variables as well member variables. llvm-svn: 248803
* [modules] Fix thread safety analysis to cope with merging of FieldDecls ↵Richard Smith2015-08-121-1/+2
| | | | | | across modules. llvm-svn: 244714
* Hide away implementation details of the ThreadSafetyAnalysis in anonymous ↵Benjamin Kramer2015-03-091-27/+11
| | | | | | | | namespaces NFC. llvm-svn: 231653
* [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+0
| | | | | | | | | | Sorry for the noise, I managed to miss a bunch of recent regressions of include orderings here. This should actually sort all the includes for Clang. Again, no functionality changed, this is just a mechanical cleanup that I try to run periodically to keep the #include lines as regular as possible across the project. llvm-svn: 225979
* Thread Safety Analysis: major update to thread safety TIL.DeLesley Hutchins2014-09-101-35/+30
| | | | | | | | | | | | Numerous changes, including: * Changed the way variables and instructions are handled in basic blocks to be more efficient. * Eliminated SExprRef. * Simplified futures. * Fixed documentation. * Compute dominator and post dominator trees. llvm-svn: 217556
* Thread safety analysis: Add support for negative requirements, which areDeLesley Hutchins2014-08-041-12/+35
| | | | | | | capability expressions of the form !expr, and denote a capability that must not be held. llvm-svn: 214725
* Thread Safety Analysis: Replace the old and broken SExpr with the newDeLesley Hutchins2014-07-281-33/+215
| | | | | | | | til::SExpr. This is a large patch, with many small changes to pretty printing and expression lowering to make the new SExpr representation equivalent in functionality to the old. llvm-svn: 214089
* Thread Safety Analysis: implement review suggestions from Aaron Ballman.DeLesley Hutchins2014-05-291-1/+1
| | | | llvm-svn: 209847
* Thread Safety Analysis: update TIL traversal mechanism to allow arbitraryDeLesley Hutchins2014-05-281-7/+10
| | | | | | local contexts. Also includes some minor refactoring. llvm-svn: 209774
* Thread Safety Analysis: add new node types to thread safety TIL.DeLesley Hutchins2014-05-151-97/+78
| | | | | | This fills in a few missing gaps in functionality. llvm-svn: 208830
* ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.Benjamin Kramer2014-05-091-4/+6
| | | | | | | | | | | The thread safety analysis isn't very useful in ObjC (you can't annotate ObjC classes or methods) but we can still analyze the actual code and show violations in usage of C/C++ functions. Fixes PR19541, which does not use thread safety attributes but crashes with -Weverything. llvm-svn: 208436
* Replacing a naked pointer with a unique_ptr. No functional changes intended.Aaron Ballman2014-04-231-3/+3
| | | | llvm-svn: 206986
* Updated to be a bit more const friendly. Also switched the linkage to be ↵Aaron Ballman2014-04-231-3/+3
| | | | | | static since this function is file-local. No functional changes intended. llvm-svn: 206982
* Thread safety analysis: add array operations to SExpr.DeLesley Hutchins2014-04-221-1/+4
| | | | llvm-svn: 206907
* Thread safety analysis: fix warning.DeLesley Hutchins2014-04-221-2/+1
| | | | llvm-svn: 206899
* Thread safety analysis: misc updates to SExpr handling. Fix to minimal SSA,DeLesley Hutchins2014-04-211-39/+85
| | | | | | function parameters, and compound assignment. llvm-svn: 206827
* Thread Safety Analysis: Convert to minimal SSA.DeLesley Hutchins2014-04-191-17/+72
| | | | llvm-svn: 206681
* Thread Safety Analysis: Update SSA pass to handle loops.DeLesley Hutchins2014-04-191-85/+169
| | | | llvm-svn: 206676
* Since the object is new'ed in the enterCFG function, now deleting in the ↵Aaron Ballman2014-04-171-0/+1
| | | | | | exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak. llvm-svn: 206471
* Thread Safety Analysis: rewrite SSA pass to use the new SExpr and CFGDeLesley Hutchins2014-04-151-89/+296
| | | | | | | traversal system. The new pass is still undergoing testing; no change in functionality. llvm-svn: 206338
* Thread Safety Analysis: reorganized SExpr header files. No change inDeLesley Hutchins2014-04-091-0/+8
| | | | | | functionality. llvm-svn: 205936
* Thread Safety Analysis: now with less includes. No functional changes.Aaron Ballman2014-04-091-1/+1
| | | | llvm-svn: 205929
* Thread Safety Analysis: some minor cleanups to the latest thread safety ↵Aaron Ballman2014-04-091-44/+34
| | | | | | | | | | | | changes. No functional changes intended. * Adds an iterator_range interface to CallExpr to get the arguments * Modifies SExpr such that it must be allocated in the Arena, and cannot be deleted * Minor const-correctness and nullptr updates * Adds some operator!= implementations to complement operator== * Removes unused functionality llvm-svn: 205915
* Thread Safety Analysis. Misc fixes to SExpr code, responding to code reviewDeLesley Hutchins2014-04-081-8/+2
| | | | | | by Aaron Ballman. llvm-svn: 205809
* Thread Safety Analysis: various fixes to new SExpr code.DeLesley Hutchins2014-04-071-20/+34
| | | | | | Implemented ownership policy, updated to use nullptr, const-cleanup. llvm-svn: 205745
* Thread Safety Analysis: update to internal SExpr handling.DeLesley Hutchins2014-04-071-0/+407
This patch is the first part of a significant refactoring that seeks to restore sanity to way thread safety analysis deals with capability expressions. The current patch merely provides an outline of the structure of the new system. It's not yet connected to the actual analysis, so there's no change in functionality. llvm-svn: 205728
OpenPOWER on IntegriCloud