Commit Graph

35 Commits

Author SHA1 Message Date
Alexander Kornienko b8b9458165 Fix typos in clang
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 15:14:32 +00:00
Eugene Zelenko 79bbdd4289 [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327453 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13 21:32:01 +00:00
Benjamin Kramer 25836be2c4 Refactor overridden methods iteration to avoid double lookups.
Convert most uses to range-for loops. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-17 23:52:45 +00:00
Richard Smith 96881be75c [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.
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'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 15:16:18 +00:00
George Karpenkov 3e4f379cb6 [CSA] [NFC] Move AnalysisContext.h to AnalysisDeclContext.h
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 21:45:03 +00:00
Richard Smith ea344c8140 DR616, and part of P0135R1: member access (or pointer-to-member access) on a
temporary produces an xvalue, not a prvalue. Support this by materializing the
temporary prior to performing the member access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:14:32 +00:00
Mehdi Amini 2e23251d3e [NFC] Header cleanup
Summary: Removed unused headers, replaced some headers with forward class declarations

Patch by: Eugene <claprix@yandex.ru>

Differential Revision: https://reviews.llvm.org/D20100

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:02:11 +00:00
Richard Smith 708f13bd1a [coroutines] Creation of promise object, lookup of operator co_await, building
of await_* calls, and AST representation for same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 06:02:45 +00:00
Hans Wennborg 94faed6137 Fix Clang-tidy modernize-use-nullptr warnings in source directories; other minor cleanups
Patch by Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D13406

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 23:40:43 +00:00
DeLesley Hutchins c8a6f2f466 Thread Safety Analysis: fix before/after checks so that they work on global
variables as well member variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248803 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-29 15:25:51 +00:00
Richard Smith 74067ba88c [modules] Fix thread safety analysis to cope with merging of FieldDecls across modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244714 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 02:17:52 +00:00
Benjamin Kramer 2a332456ba Hide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 14:19:54 +00:00
Chandler Carruth 6c1b926674 [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225979 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 11:29:14 +00:00
DeLesley Hutchins 1c11b7cda0 Thread Safety Analysis: major update to thread safety TIL.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 22:12:52 +00:00
DeLesley Hutchins d8a1fd6e9c Thread safety analysis: Add support for negative requirements, which are
capability expressions of the form !expr, and denote a capability that must
not be held.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214725 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 16:10:59 +00:00
DeLesley Hutchins 61e498ab0a Thread Safety Analysis: Replace the old and broken SExpr with the new
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214089 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-28 15:57:27 +00:00
DeLesley Hutchins a0c3f50c1c Thread Safety Analysis: implement review suggestions from Aaron Ballman.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209847 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 21:24:16 +00:00
DeLesley Hutchins 7898a018ce Thread Safety Analysis: update TIL traversal mechanism to allow arbitrary
local contexts.  Also includes some minor refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209774 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-28 21:28:13 +00:00
DeLesley Hutchins be8977c750 Thread Safety Analysis: add new node types to thread safety TIL.
This fills in a few missing gaps in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208830 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 00:50:36 +00:00
Benjamin Kramer 6f5f20570a ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-09 17:08:01 +00:00
Aaron Ballman aafc70acf9 Replacing a naked pointer with a unique_ptr. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206986 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 14:26:59 +00:00
Aaron Ballman 9107bb3471 Updated to be a bit more const friendly. Also switched the linkage to be static since this function is file-local. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206982 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23 13:58:21 +00:00
DeLesley Hutchins 4d7f4b69c4 Thread safety analysis: add array operations to SExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206907 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22 17:31:23 +00:00
DeLesley Hutchins 23be9d0217 Thread safety analysis: fix warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206899 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-22 14:51:04 +00:00
DeLesley Hutchins 2e81e1321b Thread safety analysis: misc updates to SExpr handling. Fix to minimal SSA,
function parameters, and compound assignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206827 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 23:18:18 +00:00
DeLesley Hutchins bb7d67a856 Thread Safety Analysis: Convert to minimal SSA.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206681 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-19 03:54:41 +00:00
DeLesley Hutchins 0d60af3771 Thread Safety Analysis: Update SSA pass to handle loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206676 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-19 00:35:54 +00:00
Aaron Ballman 1ae2588a17 Since the object is new'ed in the enterCFG function, now deleting in the exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 15:23:50 +00:00
DeLesley Hutchins 738fc4e15b Thread Safety Analysis: rewrite SSA pass to use the new SExpr and CFG
traversal system.  The new pass is still undergoing testing; no change in
functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206338 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 23:23:19 +00:00
DeLesley Hutchins b622f9d076 Thread Safety Analysis: reorganized SExpr header files. No change in
functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205936 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 22:39:43 +00:00
Aaron Ballman 0a2bd549e7 Thread Safety Analysis: now with less includes. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205929 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 21:12:04 +00:00
Aaron Ballman bf0b9637da Thread Safety Analysis: some minor cleanups to the latest thread safety 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 17:45:44 +00:00
DeLesley Hutchins e73ca8191c Thread Safety Analysis. Misc fixes to SExpr code, responding to code review
by Aaron Ballman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205809 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-08 22:21:22 +00:00
DeLesley Hutchins d5fbd22d26 Thread Safety Analysis: various fixes to new SExpr code.
Implemented ownership policy, updated to use nullptr, const-cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205745 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 22:56:24 +00:00
DeLesley Hutchins 745d3c96e8 Thread Safety Analysis: update to internal SExpr handling.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205728 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 18:09:54 +00:00