Skip to content

Static analyzer cherrypicks 1 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
a129173
[analyzer] RetainCount: Add support for OSRequiredCast().
haoNoQ Jun 19, 2019
1a1eb30
[analyzer] DeadStores: Add a crude suppression files generated by Dri…
haoNoQ Jun 19, 2019
fbcd0ff
[analyzer] NFC: Change evalCall() to provide a CallEvent.
haoNoQ Jun 19, 2019
767a5c4
[analyzer] Fix JSON dumps for dynamic type information.
haoNoQ Jun 19, 2019
7a8f00c
[analyzer] Fix JSON dumps for location contexts.
haoNoQ Jun 19, 2019
8ad26fd
[analyzer] Fix JSON dumps for store clusters.
haoNoQ Jun 19, 2019
57a50d2
[analyzer] exploded-graph-rewriter: Fix escaping StringRegions.
haoNoQ Jun 19, 2019
6aecb50
[analyzer] exploded-graph-rewriter: Implement a --diff mode.
haoNoQ Jun 19, 2019
4ba630a
[analyzer] DeadStores: Update the crude suppression for files generat…
haoNoQ Jun 20, 2019
292d81f
[analyzer] Fix JSON dumps for ExplodedNodes
Jun 24, 2019
1c919cf
[analyzer] print() JSONify: ProgramPoint revision
Jun 24, 2019
c08ef72
[analyzer] ExprEngine: Escape pointers in bitwise operations
Jun 25, 2019
7266f07
[analyzer] Add more timers for performance profiling.
haoNoQ Jun 25, 2019
ade7a5e
[analyzer] NFC: exploded-graph-rewriter: Extract some code into funct…
haoNoQ Jun 25, 2019
cec5820
[analyzer] exploded-graph-rewriter: Add support for range constraints.
haoNoQ Jun 25, 2019
26838f1
[analyzer] exploded-graph-rewriter: Fix escaping for bitwise-or.
haoNoQ Jun 25, 2019
db14325
[analyzer] print() JSONify: Create pointers
Jun 25, 2019
a7a7930
[analyzer] exploded-graph-rewriter: Prettier location context dumps.
haoNoQ Jun 26, 2019
8496fee
[analyzer] Fix clang-tidy crash on GCCAsmStmt
nhukc Jun 27, 2019
2a91883
[analyzer] exploded-graph-rewriter: Implement program point tags.
haoNoQ Jul 1, 2019
b30e422
[analyzer] exploded-graph-rewriter: Add support for dynamic types.
haoNoQ Jul 1, 2019
8b8a2a8
[analyzer] NFC: Add a convenient CallDescriptionMap class.
haoNoQ Jul 1, 2019
769533c
[analyzer] NFC: CallDescription: Implement describing C library funct…
haoNoQ Jul 1, 2019
9d48193
[analyzer] CStringChecker: Modernize to use CallDescriptions.
haoNoQ Jul 1, 2019
264ac3e
[analyzer] NonnullGlobalConstants: Don't be confused by a _Nonnull at…
haoNoQ Jul 1, 2019
7f5f4d5
[analyzer] Fix invalidation when returning into a ctor initializer.
haoNoQ Jul 1, 2019
75e90a7
[analyzer] Support kfree in MallocChecker
nhukc Jul 1, 2019
c2680c6
[analyzer] exploded-graph-rewriter: Add support for objects under con…
haoNoQ Jul 2, 2019
dc3ce0e
[analyzer] exploded-graph-rewriter: Improve program point dumps.
haoNoQ Jul 2, 2019
5497e33
[analyzer] exploded-graph-rewriter: Implement a dark color scheme.
haoNoQ Jul 2, 2019
9bb31d3
[IDF] Generalize IDFCalculator to be used with Clang's CFG
Szelethus Jul 2, 2019
8a0a8b3
Removed extra ; after function definition
Szelethus Jul 2, 2019
e2711bb
Attempt to fix buildbot failures with MSVC
Szelethus Jul 2, 2019
76b8d1b
Minor cleanup.
Artem-B Jul 12, 2019
56e5cd9
[analyzer] exploded-graph-rewriter: Implement checker messages.
haoNoQ Jul 3, 2019
0cb9509
[analyzer] exploded-graph-rewriter: Collapse very long statement pret…
haoNoQ Jul 3, 2019
577a874
[analyzer] exploded-graph-rewriter: NFC: Add more comments.
haoNoQ Jul 3, 2019
f7beaf3
[analyzer] exploded-graph-rewriter: Implement bug nodes and sink nodes.
haoNoQ Jul 3, 2019
1bd5a87
[Dominators] PR42041: Skip nullpointer successors
Szelethus Jul 3, 2019
b342985
[analyzer][Dominator] Add post dominators to CFG + a new debug checker
Szelethus Jul 3, 2019
e039601
Specialize an anchor() function in the correct namespace
Szelethus Jul 3, 2019
34e0c85
Make a buildbot using a buggy gcc happy
Szelethus Jul 3, 2019
01bae84
[analyzer][CFG] Return the correct terminator condition
Szelethus Jul 3, 2019
6216514
Revert "[analyzer][CFG] Return the correct terminator condition"
Szelethus Jul 3, 2019
509b06f
[analyzer] exploded-graph-rewriter: Implement a black-and-white color…
haoNoQ Jul 3, 2019
b23a7c1
[analyzer] ReturnValueChecker: Model the guaranteed boolean return va…
Jul 4, 2019
697bc2b
[CTU] Add support for virtual functions
Jul 4, 2019
727894b
[CFG] Add a new function to get the proper condition of a CFGBlock
Szelethus Jul 5, 2019
7197458
[analyzer][Dominators][NFC] Add unit tests
Szelethus Jul 5, 2019
e3c67d0
Fix a buildbot failure due to the AST's lifetime ending before the test
Szelethus Jul 5, 2019
224dd18
[analyzer][IDF] Add a control dependency calculator + a new debug che…
Szelethus Jul 5, 2019
7c6fe06
[analyzer] Track terminator conditions on which a tracked expression …
Szelethus Jul 5, 2019
de2cf58
[analyzer] Add a debug analyzer config to place an event for each tra…
Szelethus Jul 5, 2019
b4f5ac1
Removed the test case added in D63538 due to windows buildbot failures
Szelethus Jul 5, 2019
b502c82
[analyzer] Add analyzer option to limit the number of imported TUs
Jul 8, 2019
25ab0b8
[analyzer] exploded-graph-rewriter: Implement a single-path mode.
haoNoQ Jul 8, 2019
ee6a8d9
[analyzer] exploded-graph-rewriter: Implement a topology-only mode.
haoNoQ Jul 8, 2019
9a4d419
[analyzer] CastValueChecker: Model casts
Jul 10, 2019
f06353d
Revert "[analyzer] CastValueChecker: Model casts"
Jul 9, 2019
52a7a12
[analyzer] CastValueChecker: Model casts
Jul 10, 2019
b153f8e
[analyzer] CastValueChecker: Remove a dump()
Jul 10, 2019
bd14f18
[analyzer] exploded-graph-rewriter: Fix filenames in program point.
haoNoQ Jul 11, 2019
a0b89c7
[analyzer] exploded-graph-rewriter: Improve source location dumps.
haoNoQ Jul 12, 2019
47c09e3
NFC: Unforget a colon in a few CHECK: directives.
haoNoQ Jul 12, 2019
47155f0
[analyzer] MallocChecker: Prevent Integer Set Library false positives
Jul 18, 2019
c443faa
[analyzer] Fix -Wunused-function in NDEBUG builds with #ifdef LLVM_DU…
MaskRay Jul 22, 2019
1bfc7a3
[CrossTU] Added CTU argument to diagnostic consumer create fn.
balazske Jul 23, 2019
c1187cc
PlistDiagnostics Fix for compile warning (NFC).
balazske Jul 23, 2019
c1b1f83
Fix exporting SARIF files from scan-build on Windows.
AaronBallman Jul 24, 2019
34408f6
[CrossTU] Add a function to retrieve original source location.
balazske Jul 24, 2019
83306e8
[CrossTU] Fix plist macro expansion if macro in other file.
balazske Jul 25, 2019
fb6a2e4
Fix failing test plist-macros-with-expansion-ctu.c
balazske Jul 25, 2019
d385af7
[analyzer] Add yaml parser to GenericTaintChecker
boga95 Jul 28, 2019
4f3e566
Buildbot fix for r367190
boga95 Jul 28, 2019
ac22da6
Fix taint-generic.c on Windows, handle case in OS error
rnk Jul 29, 2019
86d1d30
[analyzer] StackFrameContext: Add NodeBuilderContext::blockCount() to…
Aug 1, 2019
0cdd168
[Analyzer] Iterator Checkers - Fix for Crash on Iterator Differences
Aug 5, 2019
da029db
[analyzer] Fix scan-build's plist output in plist-html mode.
haoNoQ Aug 8, 2019
f92e410
[analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPieces
Aug 9, 2019
e4f5bee
[analyzer] CastValueChecker: Model castAs(), getAs()
Aug 9, 2019
ae73909
[analyzer][NFC] Refactoring BugReporter.cpp P1.: Store interesting sy…
Szelethus Aug 13, 2019
ceaf317
[analyzer][NFC] Refactoring BugReporter.cpp P2.: Clean up the constru…
Szelethus Aug 13, 2019
830bb80
[analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer<…
Szelethus Aug 13, 2019
03ba03c
[analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, …
Szelethus Aug 13, 2019
2bda66a
[analyzer][NFC] Refactoring BugReporter.cpp P5.: Compact mile long fu…
Szelethus Aug 13, 2019
6e8af13
[analyzer][NFC] Address inlines of D65484
Szelethus Aug 13, 2019
b68349e
Remove the extra `;`.
darkbuck Aug 13, 2019
d659255
[analyzer][NFC] Refactoring BugReporter.cpp P6.: Completely get rid o…
Szelethus Aug 13, 2019
8e595b6
[analyzer][NFC] Make sure that the BugReport is not modified during t…
Szelethus Aug 13, 2019
5d52cad
[analyzer] Disable the checker-plugins test on Darwin.
haoNoQ Aug 13, 2019
082a04e
[analyzer] exploded-graph-rewriter: Open the converted graph immediat…
haoNoQ Aug 13, 2019
6fb513c
[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trim…
haoNoQ Aug 13, 2019
58304c8
[analyzer] exploded-graph-rewriter: Implement manual graph trimming.
haoNoQ Aug 13, 2019
9daf5aa
[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.
haoNoQ Aug 13, 2019
64a7601
[analyzer] Prune calls to functions with linear CFGs that return a no…
Szelethus Aug 13, 2019
c47b77d
[analyzer] Track the right hand side of the last store regardless of …
Szelethus Aug 13, 2019
65cdff4
[analyzer][NFC] Prepare visitors for different tracking kinds
Szelethus Aug 14, 2019
2bc5f14
[analyzer] Don't delete TaintConfig copy constructor
bulbazord Aug 14, 2019
46c51f4
Fix the -Wunused-variable warning.
hokein Aug 14, 2019
915553a
[analyzer] Note last writes to a condition only in a nested stackframe
Szelethus Aug 14, 2019
38af1e5
[analyzer][CFG] Don't track the condition of asserts
Szelethus Aug 14, 2019
76e9a32
[analyzer][NFC] Prove that we only track the evaluated part of the co…
Szelethus Aug 14, 2019
b61668f
[CFG] Introduce CFGElementRef, a wrapper that knows it's position in …
Szelethus Aug 14, 2019
80789df
[NFCI] Always initialize BugReport const fields
bulbazord Aug 15, 2019
23ab9d8
[analyzer] Warn about -analyzer-configs being meant for development p…
Szelethus Aug 15, 2019
b2b970a
[analyzer] Analysis: Silence checkers
Aug 16, 2019
67b9d76
[analyzer] Turn an assert into an if condition
Szelethus Aug 17, 2019
1131e93
[analyzer] NFC: Drop support for extra text attached to bug reports.
haoNoQ Aug 20, 2019
d7d5a99
[analyzer] NFC: Rename GRBugReporter to PathSensitiveBugReporter.
haoNoQ Aug 20, 2019
59d2c07
[CallGraph] Take into accound calls that aren't within any function b…
haoNoQ Aug 20, 2019
859e660
[analyzer] Improve VirtualCallChecker and enable parts of it by default.
haoNoQ Aug 20, 2019
37f9ef0
[analyzer] Fix a crash when destroying a non-region.
haoNoQ Aug 20, 2019
04abbac
[analyzer] NFC: Remove the BugTypes set from BugReporter.
haoNoQ Aug 20, 2019
e6b0eed
Removed some dead code in BugReporter and related files
gribozavr Aug 21, 2019
0f21765
[analyzer] Mention whether an event is about a condition in a bug rep…
Szelethus Aug 21, 2019
cac5f30
[analyzer][NFC] Add different interestingness kinds
Szelethus Aug 21, 2019
280b7ed
[analyzer] Don't make ConditionBRVisitor events prunable when the con…
Szelethus Aug 21, 2019
29ce5ea
[analyzer] Mention whether an event is about a condition in a bug rep…
Szelethus Aug 21, 2019
2e39e0d
[analyzer] TrackConstraintBRVisitor: Do not track unknown values
Aug 22, 2019
372a835
[analyzer] CastValueChecker: Store the dynamic types and casts
Aug 22, 2019
80c6a0d
[analyzer] CastValueChecker: Rewrite dead header hotfix
Aug 22, 2019
f339739
[analyzer] CastValueChecker: Try to fix the buildbots
Aug 22, 2019
0376405
[analyzer] Don't track the condition of foreach loops
Szelethus Aug 22, 2019
818dd65
[analyzer] CastValueChecker: Model isa(), isa_and_nonnull()
Aug 22, 2019
aaa2160
[analyzer] Enable control dependency condition tracking by default
Szelethus Aug 22, 2019
5af8cb0
Remove an unused function, suppress -Wunused-function warning.
hokein Aug 22, 2019
cfe5b5e
[analyzer] DynamicTypeInfo: Avoid putting null regions into dynamic t…
haoNoQ Aug 23, 2019
00e714c
[analyzer] CastValueChecker: Avoid modeling casts between objects.
haoNoQ Aug 23, 2019
fd6e1ad
[analyzer] CastValueChecker: Provide DynamicTypeMap with pointer type…
haoNoQ Aug 23, 2019
e1f0dc2
[analyzer] CastValueChecker: Correctly model results of based-to-deri…
haoNoQ Aug 23, 2019
70e388f
[analyzer] Avoid unnecessary enum range check on LValueToRValue casts
Aug 23, 2019
c867f49
[analyzer] Analysis: Fix checker silencing
Aug 24, 2019
a5881a2
[analyzer] Trust global initializers when analyzing main().
haoNoQ Aug 28, 2019
e4af1c1
[analyzer] pr43036: Fix support for operator 'sizeof...'.
haoNoQ Aug 28, 2019
4538b74
[analyzer] Fix analyzer warnings on analyzer.
haoNoQ Aug 28, 2019
fda60dd
[CFG] Make representation of destructor calls more accurate.
haoNoQ Aug 28, 2019
035b74e
[analyzer] Fix more analyzer warnings on analyzer and libAnalysis.
haoNoQ Aug 28, 2019
807d0ec
[Analyzer] Iterator Checkers - Make range errors and invalidated acce…
Aug 29, 2019
2a829ba
[CFG] Fix CFG for statement-expressions in return values.
haoNoQ Aug 29, 2019
0332d84
[analyzer] Add a checker option to detect nested dead stores
Sep 3, 2019
d0af813
[analyzer] NonNullParamChecker and CStringChecker parameter number in…
Sep 3, 2019
c1a51bd
Unbreak the build after r370798
d0k Sep 3, 2019
8f90df1
[analyzer] scan-build: handle --sysroot=/path in addition to --sysroo…
haoNoQ Sep 5, 2019
69ca3da
[analyzer] pr43179: Make CallDescription defensive against C variadic…
haoNoQ Sep 6, 2019
373f8bc
[analyzer] Add minimal support for fix-it hints.
haoNoQ Sep 6, 2019
67419f1
Move prop-sink branch to monorepo.
boga95 Sep 8, 2019
9dbd22a
[analyzer] NFC: Introduce sub-classes for path-sensitive and basic re…
haoNoQ Sep 9, 2019
decdf63
[analyzer] NFC: Simplify bug report equivalence classes to not be ili…
haoNoQ Sep 9, 2019
707c3f5
[analyzer] NFC: Re-implement stack hints as a side map in BugReport.
haoNoQ Sep 11, 2019
4ed346d
[analyzer] NFC: Move getStmt() and createEndOfPath() out of PathDiagn…
haoNoQ Sep 11, 2019
1c5ee0c
[analyzer] NFC: Move resetDiagnosticLocationToMainFile() to BugReporter.
haoNoQ Sep 11, 2019
fa82362
[analyzer] NFC: Move PathDiagnostic classes to libAnalysis.
haoNoQ Sep 11, 2019
5801e63
[analyzer] Don't run the analyzer for -analyzer-list-enabled-checkers
Sep 12, 2019
080f156
[analyzer][NFC] Fix inconsistent references to checkers as "checks"
Sep 12, 2019
786ed1e
[ClangTidy] Adjust the name getCheckName to getCheckerName due to API…
timshen91 Sep 12, 2019
3346f0b
[CFG] Add dumps for CFGElement and CFGElementRef
Sep 12, 2019
7d0f759
[analyzer] Fix the 'analyzer-enabled-checkers.c' test on non-linux ma…
haoNoQ Sep 12, 2019
804e170
Fix a perl warning: Scalar value @ArgParts[0] better written as $ArgP…
sylvestre Sep 13, 2019
25cbd18
[analyzer] PR43102: Fix an assertion and an out-of-bounds error for d…
Sep 18, 2019
60641f9
[StaticAnalyzer] Use llvm::StringLiteral instead of StringRef in few …
d0k Sep 20, 2019
d0c7973
Reland '[analyzer][MallocChecker][NFC] Document and reorganize some f…
Sep 20, 2019
adc75dc
Fix a documentation error
Sep 20, 2019
d7cbbf0
Attempt to fix a windows buildbot failure
Sep 21, 2019
40f5913
[NFCI] Return PathSensitiveBugReport where appropriate
bulbazord Sep 23, 2019
34eb3ca
[analyzer] Avoid small vectors of non-default-constructibles.
haoNoQ Sep 26, 2019
8bb333a
Don't install example analyzer plugins
aaronpuchert Sep 28, 2019
bee81d3
Teach CallGraph to look into Generic Lambdas.
Sep 30, 2019
da07275
BlockInCriticalSectionChecker - silence static analyzer dyn_cast null…
RKSimon Oct 13, 2019
27bfa17
[analyzer] exploded-graph-rewriter: Make node headers a bit lighter.
haoNoQ Oct 17, 2019
0e07329
[analyzer] Display cast kinds in program point dumps.
haoNoQ Oct 17, 2019
e9b4862
[analyzer] Assign truly stable identifiers to exploded nodes.
haoNoQ Oct 17, 2019
0ebcbd1
[analyzer] exploded-graph-rewriter: Fix typo in r375186. Unbreaks tests.
haoNoQ Oct 17, 2019
00e99fc
[analyzer] Fix hidden node traversal in exploded graph dumps.
haoNoQ Oct 18, 2019
4db5dff
[analyzer] exploded-graph-rewriter: Fix dump for state 0.
haoNoQ Oct 18, 2019
a528b53
[analyzer] Drop the logic for collapsing the state if it's same as in…
haoNoQ Oct 18, 2019
048cc7c
[analyzer] Fix FieldRegion dumps.
haoNoQ Oct 18, 2019
8e66c8b
[analyzer] exploded-graph-rewriter: Rename Environment to Expressions.
haoNoQ Oct 18, 2019
e2698a7
[analyzer] exploded-graph-rewriter: Unforget to censor stmt_ids in th…
haoNoQ Oct 18, 2019
750990e
[analyzer] Specify the C++ standard in more tests.
haoNoQ Oct 19, 2019
dcb65b6
[analyzer] Fix off-by-one in operator call parameter binding.
haoNoQ Oct 23, 2019
7fb1a17
Revert "Teach CallGraph to look into Generic Lambdas."
haoNoQ Oct 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 12 additions & 11 deletions clang-tools-extra/clang-tidy/ClangTidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
#include "clang/Rewrite/Frontend/FixItRewriter.h"
#include "clang/Rewrite/Frontend/FrontendActions.h"
#include "clang/Tooling/Core/Diagnostic.h"
#if CLANG_ENABLE_STATIC_ANALYZER
#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
#endif // CLANG_ENABLE_STATIC_ANALYZER
#include "clang/Tooling/DiagnosticsYaml.h"
#include "clang/Tooling/Refactoring.h"
#include "clang/Tooling/ReplacementsYaml.h"
Expand All @@ -50,6 +46,11 @@
#include <algorithm>
#include <utility>

#if CLANG_ENABLE_STATIC_ANALYZER
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
#endif // CLANG_ENABLE_STATIC_ANALYZER

using namespace clang::ast_matchers;
using namespace clang::driver;
using namespace clang::tooling;
Expand All @@ -72,7 +73,7 @@ class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
FilesMade *filesMade) override {
for (const ento::PathDiagnostic *PD : Diags) {
SmallString<64> CheckName(AnalyzerCheckNamePrefix);
CheckName += PD->getCheckName();
CheckName += PD->getCheckerName();
Context.diag(CheckName, PD->getLocation().asLocation(),
PD->getShortDescription())
<< PD->path.back()->getRanges();
Expand Down Expand Up @@ -335,8 +336,8 @@ static void setStaticAnalyzerCheckerOpts(const ClangTidyOptions &Opts,

typedef std::vector<std::pair<std::string, bool>> CheckersList;

static CheckersList getCheckersControlList(ClangTidyContext &Context,
bool IncludeExperimental) {
static CheckersList getAnalyzerCheckersAndPackages(ClangTidyContext &Context,
bool IncludeExperimental) {
CheckersList List;

const auto &RegisteredCheckers =
Expand Down Expand Up @@ -420,9 +421,9 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(

#if CLANG_ENABLE_STATIC_ANALYZER
AnalyzerOptionsRef AnalyzerOptions = Compiler.getAnalyzerOpts();
AnalyzerOptions->CheckersControlList =
getCheckersControlList(Context, Context.canEnableAnalyzerAlphaCheckers());
if (!AnalyzerOptions->CheckersControlList.empty()) {
AnalyzerOptions->CheckersAndPackages = getAnalyzerCheckersAndPackages(
Context, Context.canEnableAnalyzerAlphaCheckers());
if (!AnalyzerOptions->CheckersAndPackages.empty()) {
setStaticAnalyzerCheckerOpts(Context.getOptions(), AnalyzerOptions);
AnalyzerOptions->AnalysisStoreOpt = RegionStoreModel;
AnalyzerOptions->AnalysisDiagOpt = PD_NONE;
Expand All @@ -448,7 +449,7 @@ std::vector<std::string> ClangTidyASTConsumerFactory::getCheckNames() {
}

#if CLANG_ENABLE_STATIC_ANALYZER
for (const auto &AnalyzerCheck : getCheckersControlList(
for (const auto &AnalyzerCheck : getAnalyzerCheckersAndPackages(
Context, Context.canEnableAnalyzerAlphaCheckers()))
CheckNames.push_back(AnalyzerCheckNamePrefix + AnalyzerCheck.first);
#endif // CLANG_ENABLE_STATIC_ANALYZER
Expand Down
9 changes: 9 additions & 0 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ Check for values stored to variables that are never read afterwards.
x = 1; // warn
}

The ``WarnForDeadNestedAssignments`` option enables the checker to emit
warnings for nested dead assignments. You can disable with the
``-analyzer-config deadcode.DeadStores:WarnForDeadNestedAssignments=false``.
*Defaults to true*.

Would warn for this e.g.:
if ((y = make_int())) {
}

.. _nullability-checkers:

nullability
Expand Down
12 changes: 12 additions & 0 deletions clang/include/clang/AST/ASTImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class TypeSourceInfo;
using NonEquivalentDeclSet = llvm::DenseSet<std::pair<Decl *, Decl *>>;
using ImportedCXXBaseSpecifierMap =
llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *>;
using FileIDImportHandlerType =
std::function<void(FileID /*ToID*/, FileID /*FromID*/)>;

enum class ODRHandlingType { Conservative, Liberal };

Expand Down Expand Up @@ -211,6 +213,8 @@ class TypeSourceInfo;
};

private:
FileIDImportHandlerType FileIDImportHandler;

std::shared_ptr<ASTImporterSharedState> SharedState = nullptr;

/// The path which we go through during the import of a given AST node.
Expand Down Expand Up @@ -313,6 +317,14 @@ class TypeSourceInfo;

virtual ~ASTImporter();

/// Set a callback function for FileID import handling.
/// The function is invoked when a FileID is imported from the From context.
/// The imported FileID in the To context and the original FileID in the
/// From context is passed to it.
void setFileIDImportHandler(FileIDImportHandlerType H) {
FileIDImportHandler = H;
}

/// Whether the importer will perform a minimal import, creating
/// to-be-completed forward declarations when possible.
bool isMinimalImport() const { return Minimal; }
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@ class QualType {
friend bool operator!=(const QualType &LHS, const QualType &RHS) {
return LHS.Value != RHS.Value;
}
friend bool operator<(const QualType &LHS, const QualType &RHS) {
return LHS.Value < RHS.Value;
}

static std::string getAsString(SplitQualType split,
const PrintingPolicy &Policy) {
Expand Down
Loading