blob: 810e0661782b12067c5c0e0ed8ad04968c47bc29 [file] [log] [blame]
Kristof Umann30f08652018-06-18 11:50:17 +00001//===----- UninitializedObjectChecker.cpp ------------------------*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines a checker that reports uninitialized fields in objects
11// created after a constructor call.
12//
Kristof Umanna3f7b582018-08-07 12:55:26 +000013// This checker has several options:
Kristof Umann9bd44392018-06-29 11:25:24 +000014// - "Pedantic" (boolean). If its not set or is set to false, the checker
15// won't emit warnings for objects that don't have at least one initialized
16// field. This may be set with
17//
Kristof Umanna3f7b582018-08-07 12:55:26 +000018// `-analyzer-config alpha.cplusplus.UninitializedObject:Pedantic=true`.
Kristof Umann9bd44392018-06-29 11:25:24 +000019//
20// - "NotesAsWarnings" (boolean). If set to true, the checker will emit a
21// warning for each uninitalized field, as opposed to emitting one warning
22// per constructor call, and listing the uninitialized fields that belongs
23// to it in notes. Defaults to false.
24//
Kristof Umanna3f7b582018-08-07 12:55:26 +000025// `-analyzer-config \
26// alpha.cplusplus.UninitializedObject:NotesAsWarnings=true`.
27//
28// - "CheckPointeeInitialization" (boolean). If set to false, the checker will
29// not analyze the pointee of pointer/reference fields, and will only check
30// whether the object itself is initialized. Defaults to false.
31//
32// `-analyzer-config \
33// alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=true`.
34//
35// TODO: With some clever heuristics, some pointers should be dereferenced
36// by default. For example, if the pointee is constructed within the
37// constructor call, it's reasonable to say that no external object
38// references it, and we wouldn't generate multiple report on the same
39// pointee.
Kristof Umann30f08652018-06-18 11:50:17 +000040//
Kristof Umann56963ae2018-08-13 18:17:05 +000041// To read about how the checker works, refer to the comments in
42// UninitializedObject.h.
43//
44// Some of the logic is implemented in UninitializedPointee.cpp, to reduce the
45// complexity of this file.
46//
Kristof Umann30f08652018-06-18 11:50:17 +000047//===----------------------------------------------------------------------===//
48
Richard Smith651d6832018-08-13 22:07:11 +000049#include "../ClangSACheckers.h"
Kristof Umanna37bba42018-08-13 18:22:22 +000050#include "UninitializedObject.h"
Kristof Umann30f08652018-06-18 11:50:17 +000051#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
52#include "clang/StaticAnalyzer/Core/Checker.h"
53#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
Kristof Umannef9af052018-08-08 13:18:53 +000054#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h"
Kristof Umann30f08652018-06-18 11:50:17 +000055
56using namespace clang;
57using namespace clang::ento;
58
59namespace {
60
61class UninitializedObjectChecker : public Checker<check::EndFunction> {
62 std::unique_ptr<BuiltinBug> BT_uninitField;
63
64public:
Kristof Umann9bd44392018-06-29 11:25:24 +000065 // These fields will be initialized when registering the checker.
66 bool IsPedantic;
67 bool ShouldConvertNotesToWarnings;
Kristof Umanna3f7b582018-08-07 12:55:26 +000068 bool CheckPointeeInitialization;
Kristof Umann30f08652018-06-18 11:50:17 +000069
70 UninitializedObjectChecker()
71 : BT_uninitField(new BuiltinBug(this, "Uninitialized fields")) {}
Reka Kovacsed8c05c2018-07-16 20:47:45 +000072 void checkEndFunction(const ReturnStmt *RS, CheckerContext &C) const;
Kristof Umann30f08652018-06-18 11:50:17 +000073};
74
Kristof Umann015b0592018-08-13 18:43:08 +000075/// A basic field type, that is not a pointer or a reference, it's dynamic and
76/// static type is the same.
Richard Smith651d6832018-08-13 22:07:11 +000077class RegularField final : public FieldNode {
Kristof Umann015b0592018-08-13 18:43:08 +000078public:
79 RegularField(const FieldRegion *FR) : FieldNode(FR) {}
80
81 virtual void printNoteMsg(llvm::raw_ostream &Out) const override {
82 Out << "uninitialized field ";
83 }
84
85 virtual void printPrefix(llvm::raw_ostream &Out) const override {}
86
Richard Smith651d6832018-08-13 22:07:11 +000087 virtual void printNode(llvm::raw_ostream &Out) const override {
Kristof Umann015b0592018-08-13 18:43:08 +000088 Out << getVariableName(getDecl());
89 }
90
91 virtual void printSeparator(llvm::raw_ostream &Out) const override {
92 Out << '.';
93 }
94};
95
Kristof Umanncc852442018-07-12 13:13:46 +000096} // end of anonymous namespace
97
Kristof Umann30f08652018-06-18 11:50:17 +000098// Utility function declarations.
99
100/// Returns the object that was constructed by CtorDecl, or None if that isn't
101/// possible.
Kristof Umann0735cfb2018-08-08 12:23:02 +0000102// TODO: Refactor this function so that it returns the constructed object's
103// region.
Kristof Umanncc852442018-07-12 13:13:46 +0000104static Optional<nonloc::LazyCompoundVal>
Kristof Umann30f08652018-06-18 11:50:17 +0000105getObjectVal(const CXXConstructorDecl *CtorDecl, CheckerContext &Context);
106
Kristof Umann0735cfb2018-08-08 12:23:02 +0000107/// Checks whether the object constructed by \p Ctor will be analyzed later
108/// (e.g. if the object is a field of another object, in which case we'd check
109/// it multiple times).
110static bool willObjectBeAnalyzedLater(const CXXConstructorDecl *Ctor,
Kristof Umanna37bba42018-08-13 18:22:22 +0000111 CheckerContext &Context);
Kristof Umann30f08652018-06-18 11:50:17 +0000112
Kristof Umann30f08652018-06-18 11:50:17 +0000113//===----------------------------------------------------------------------===//
114// Methods for UninitializedObjectChecker.
115//===----------------------------------------------------------------------===//
116
117void UninitializedObjectChecker::checkEndFunction(
Reka Kovacsed8c05c2018-07-16 20:47:45 +0000118 const ReturnStmt *RS, CheckerContext &Context) const {
Kristof Umann30f08652018-06-18 11:50:17 +0000119
120 const auto *CtorDecl = dyn_cast_or_null<CXXConstructorDecl>(
121 Context.getLocationContext()->getDecl());
122 if (!CtorDecl)
123 return;
124
125 if (!CtorDecl->isUserProvided())
126 return;
127
128 if (CtorDecl->getParent()->isUnion())
129 return;
130
131 // This avoids essentially the same error being reported multiple times.
Kristof Umann0735cfb2018-08-08 12:23:02 +0000132 if (willObjectBeAnalyzedLater(CtorDecl, Context))
Kristof Umann30f08652018-06-18 11:50:17 +0000133 return;
134
135 Optional<nonloc::LazyCompoundVal> Object = getObjectVal(CtorDecl, Context);
136 if (!Object)
137 return;
138
Kristof Umann23ca9662018-08-13 18:48:34 +0000139 FindUninitializedFields F(Context.getState(), Object->getRegion(),
Kristof Umanna3f7b582018-08-07 12:55:26 +0000140 CheckPointeeInitialization);
Kristof Umann30f08652018-06-18 11:50:17 +0000141
Kristof Umann015b0592018-08-13 18:43:08 +0000142 const UninitFieldMap &UninitFields = F.getUninitFields();
Kristof Umann30f08652018-06-18 11:50:17 +0000143
144 if (UninitFields.empty())
145 return;
146
Kristof Umann23ca9662018-08-13 18:48:34 +0000147 // In non-pedantic mode, if Object's region doesn't contain a single
148 // initialized field, we'll assume that Object was intentionally left
149 // uninitialized.
150 if (!IsPedantic && !F.isAnyFieldInitialized())
151 return;
152
Kristof Umann30f08652018-06-18 11:50:17 +0000153 // There are uninitialized fields in the record.
154
155 ExplodedNode *Node = Context.generateNonFatalErrorNode(Context.getState());
156 if (!Node)
157 return;
158
159 PathDiagnosticLocation LocUsedForUniqueing;
160 const Stmt *CallSite = Context.getStackFrame()->getCallSite();
161 if (CallSite)
162 LocUsedForUniqueing = PathDiagnosticLocation::createBegin(
163 CallSite, Context.getSourceManager(), Node->getLocationContext());
164
Kristof Umann9bd44392018-06-29 11:25:24 +0000165 // For Plist consumers that don't support notes just yet, we'll convert notes
166 // to warnings.
167 if (ShouldConvertNotesToWarnings) {
Kristof Umann015b0592018-08-13 18:43:08 +0000168 for (const auto &Pair : UninitFields) {
Kristof Umann9bd44392018-06-29 11:25:24 +0000169
170 auto Report = llvm::make_unique<BugReport>(
Kristof Umann015b0592018-08-13 18:43:08 +0000171 *BT_uninitField, Pair.second, Node, LocUsedForUniqueing,
Kristof Umann9bd44392018-06-29 11:25:24 +0000172 Node->getLocationContext()->getDecl());
173 Context.emitReport(std::move(Report));
174 }
175 return;
176 }
177
Kristof Umann30f08652018-06-18 11:50:17 +0000178 SmallString<100> WarningBuf;
179 llvm::raw_svector_ostream WarningOS(WarningBuf);
180 WarningOS << UninitFields.size() << " uninitialized field"
181 << (UninitFields.size() == 1 ? "" : "s")
182 << " at the end of the constructor call";
183
184 auto Report = llvm::make_unique<BugReport>(
185 *BT_uninitField, WarningOS.str(), Node, LocUsedForUniqueing,
186 Node->getLocationContext()->getDecl());
187
Kristof Umann015b0592018-08-13 18:43:08 +0000188 for (const auto &Pair : UninitFields) {
189 Report->addNote(Pair.second,
190 PathDiagnosticLocation::create(Pair.first->getDecl(),
Kristof Umann30f08652018-06-18 11:50:17 +0000191 Context.getSourceManager()));
192 }
Kristof Umann30f08652018-06-18 11:50:17 +0000193 Context.emitReport(std::move(Report));
194}
195
196//===----------------------------------------------------------------------===//
197// Methods for FindUninitializedFields.
198//===----------------------------------------------------------------------===//
199
200FindUninitializedFields::FindUninitializedFields(
Kristof Umann23ca9662018-08-13 18:48:34 +0000201 ProgramStateRef State, const TypedValueRegion *const R,
Kristof Umanna3f7b582018-08-07 12:55:26 +0000202 bool CheckPointeeInitialization)
Kristof Umann23ca9662018-08-13 18:48:34 +0000203 : State(State), ObjectR(R),
204 CheckPointeeInitialization(CheckPointeeInitialization) {
Kristof Umann30f08652018-06-18 11:50:17 +0000205
Kristof Umann015b0592018-08-13 18:43:08 +0000206 isNonUnionUninit(ObjectR, FieldChainInfo(ChainFactory));
Kristof Umann30f08652018-06-18 11:50:17 +0000207}
208
209bool FindUninitializedFields::addFieldToUninits(FieldChainInfo Chain) {
210 if (State->getStateManager().getContext().getSourceManager().isInSystemHeader(
Kristof Umann015b0592018-08-13 18:43:08 +0000211 Chain.getUninitRegion()->getDecl()->getLocation()))
Kristof Umann30f08652018-06-18 11:50:17 +0000212 return false;
213
Kristof Umann015b0592018-08-13 18:43:08 +0000214 UninitFieldMap::mapped_type NoteMsgBuf;
215 llvm::raw_svector_ostream OS(NoteMsgBuf);
216 Chain.printNoteMsg(OS);
217 return UninitFields
218 .insert(std::make_pair(Chain.getUninitRegion(), std::move(NoteMsgBuf)))
219 .second;
Kristof Umann30f08652018-06-18 11:50:17 +0000220}
221
222bool FindUninitializedFields::isNonUnionUninit(const TypedValueRegion *R,
223 FieldChainInfo LocalChain) {
224 assert(R->getValueType()->isRecordType() &&
225 !R->getValueType()->isUnionType() &&
226 "This method only checks non-union record objects!");
227
228 const RecordDecl *RD =
229 R->getValueType()->getAs<RecordType>()->getDecl()->getDefinition();
230 assert(RD && "Referred record has no definition");
231
232 bool ContainsUninitField = false;
233
234 // Are all of this non-union's fields initialized?
235 for (const FieldDecl *I : RD->fields()) {
236
237 const auto FieldVal =
238 State->getLValue(I, loc::MemRegionVal(R)).castAs<loc::MemRegionVal>();
239 const auto *FR = FieldVal.getRegionAs<FieldRegion>();
240 QualType T = I->getType();
241
242 // If LocalChain already contains FR, then we encountered a cyclic
243 // reference. In this case, region FR is already under checking at an
244 // earlier node in the directed tree.
245 if (LocalChain.contains(FR))
246 return false;
247
248 if (T->isStructureOrClassType()) {
Kristof Umann015b0592018-08-13 18:43:08 +0000249 if (isNonUnionUninit(FR, LocalChain.add(RegularField(FR))))
Kristof Umann30f08652018-06-18 11:50:17 +0000250 ContainsUninitField = true;
251 continue;
252 }
253
254 if (T->isUnionType()) {
255 if (isUnionUninit(FR)) {
Kristof Umann015b0592018-08-13 18:43:08 +0000256 if (addFieldToUninits(LocalChain.add(RegularField(FR))))
Kristof Umann30f08652018-06-18 11:50:17 +0000257 ContainsUninitField = true;
258 } else
259 IsAnyFieldInitialized = true;
260 continue;
261 }
262
263 if (T->isArrayType()) {
264 IsAnyFieldInitialized = true;
265 continue;
266 }
267
George Karpenkove3b1d962018-08-13 23:32:15 +0000268 if (T->isAnyPointerType() || T->isReferenceType() || T->isBlockPointerType()) {
Kristof Umann30f08652018-06-18 11:50:17 +0000269 if (isPointerOrReferenceUninit(FR, LocalChain))
270 ContainsUninitField = true;
271 continue;
272 }
273
Kristof Umann20e85ba2018-06-19 08:35:02 +0000274 if (isPrimitiveType(T)) {
275 SVal V = State->getSVal(FieldVal);
Kristof Umann30f08652018-06-18 11:50:17 +0000276
Kristof Umann20e85ba2018-06-19 08:35:02 +0000277 if (isPrimitiveUninit(V)) {
Kristof Umann015b0592018-08-13 18:43:08 +0000278 if (addFieldToUninits(LocalChain.add(RegularField(FR))))
Kristof Umann20e85ba2018-06-19 08:35:02 +0000279 ContainsUninitField = true;
280 }
281 continue;
Kristof Umann30f08652018-06-18 11:50:17 +0000282 }
Kristof Umann20e85ba2018-06-19 08:35:02 +0000283
284 llvm_unreachable("All cases are handled!");
Kristof Umann30f08652018-06-18 11:50:17 +0000285 }
286
287 // Checking bases.
Kristof Umann0735cfb2018-08-08 12:23:02 +0000288 // FIXME: As of now, because of `willObjectBeAnalyzedLater`, objects whose
289 // type is a descendant of another type will emit warnings for uninitalized
Kristof Umann30f08652018-06-18 11:50:17 +0000290 // inherited members.
291 // This is not the only way to analyze bases of an object -- if we didn't
292 // filter them out, and didn't analyze the bases, this checker would run for
293 // each base of the object in order of base initailization and in theory would
294 // find every uninitalized field. This approach could also make handling
295 // diamond inheritances more easily.
296 //
297 // This rule (that a descendant type's cunstructor is responsible for
298 // initializing inherited data members) is not obvious, and should it should
299 // be.
300 const auto *CXXRD = dyn_cast<CXXRecordDecl>(RD);
301 if (!CXXRD)
302 return ContainsUninitField;
303
304 for (const CXXBaseSpecifier &BaseSpec : CXXRD->bases()) {
305 const auto *BaseRegion = State->getLValue(BaseSpec, R)
306 .castAs<loc::MemRegionVal>()
307 .getRegionAs<TypedValueRegion>();
308
309 if (isNonUnionUninit(BaseRegion, LocalChain))
310 ContainsUninitField = true;
311 }
312
313 return ContainsUninitField;
314}
315
316bool FindUninitializedFields::isUnionUninit(const TypedValueRegion *R) {
317 assert(R->getValueType()->isUnionType() &&
318 "This method only checks union objects!");
319 // TODO: Implement support for union fields.
320 return false;
321}
322
Kristof Umann30f08652018-06-18 11:50:17 +0000323bool FindUninitializedFields::isPrimitiveUninit(const SVal &V) {
324 if (V.isUndef())
325 return true;
326
327 IsAnyFieldInitialized = true;
328 return false;
329}
330
331//===----------------------------------------------------------------------===//
332// Methods for FieldChainInfo.
333//===----------------------------------------------------------------------===//
334
Kristof Umann015b0592018-08-13 18:43:08 +0000335const FieldRegion *FieldChainInfo::getUninitRegion() const {
Kristof Umann30f08652018-06-18 11:50:17 +0000336 assert(!Chain.isEmpty() && "Empty fieldchain!");
Kristof Umann015b0592018-08-13 18:43:08 +0000337 return (*Chain.begin()).getRegion();
Kristof Umann30f08652018-06-18 11:50:17 +0000338}
339
Kristof Umann015b0592018-08-13 18:43:08 +0000340bool FieldChainInfo::contains(const FieldRegion *FR) const {
341 for (const FieldNode &Node : Chain) {
342 if (Node.isSameRegion(FR))
343 return true;
344 }
345 return false;
Kristof Umann30f08652018-06-18 11:50:17 +0000346}
347
Kristof Umanna37bba42018-08-13 18:22:22 +0000348/// Prints every element except the last to `Out`. Since ImmutableLists store
349/// elements in reverse order, and have no reverse iterators, we use a
350/// recursive function to print the fieldchain correctly. The last element in
351/// the chain is to be printed by `print`.
352static void printTail(llvm::raw_ostream &Out,
353 const FieldChainInfo::FieldChainImpl *L);
354
Kristof Umannef9af052018-08-08 13:18:53 +0000355// TODO: This function constructs an incorrect string if a void pointer is a
356// part of the chain:
357//
358// struct B { int x; }
359//
360// struct A {
361// void *vptr;
362// A(void* vptr) : vptr(vptr) {}
363// };
364//
365// void f() {
366// B b;
367// A a(&b);
368// }
369//
370// The note message will be "uninitialized field 'this->vptr->x'", even though
371// void pointers can't be dereferenced. This should be changed to "uninitialized
372// field 'static_cast<B*>(this->vptr)->x'".
373//
Kristof Umann30f08652018-06-18 11:50:17 +0000374// TODO: This function constructs an incorrect fieldchain string in the
375// following case:
376//
377// struct Base { int x; };
378// struct D1 : Base {}; struct D2 : Base {};
379//
380// struct MostDerived : D1, D2 {
381// MostDerived() {}
382// }
383//
384// A call to MostDerived::MostDerived() will cause two notes that say
385// "uninitialized field 'this->x'", but we can't refer to 'x' directly,
386// we need an explicit namespace resolution whether the uninit field was
387// 'D1::x' or 'D2::x'.
Kristof Umann015b0592018-08-13 18:43:08 +0000388void FieldChainInfo::printNoteMsg(llvm::raw_ostream &Out) const {
Kristof Umann30f08652018-06-18 11:50:17 +0000389 if (Chain.isEmpty())
390 return;
391
Kristof Umanna37bba42018-08-13 18:22:22 +0000392 const FieldChainImpl *L = Chain.getInternalPointer();
Kristof Umann015b0592018-08-13 18:43:08 +0000393 const FieldNode &LastField = L->getHead();
394
395 LastField.printNoteMsg(Out);
396 Out << '\'';
397
398 for (const FieldNode &Node : Chain)
399 Node.printPrefix(Out);
400
401 Out << "this->";
Kristof Umann30f08652018-06-18 11:50:17 +0000402 printTail(Out, L->getTail());
Kristof Umann015b0592018-08-13 18:43:08 +0000403 LastField.printNode(Out);
404 Out << '\'';
Kristof Umann30f08652018-06-18 11:50:17 +0000405}
406
Kristof Umanna37bba42018-08-13 18:22:22 +0000407static void printTail(llvm::raw_ostream &Out,
408 const FieldChainInfo::FieldChainImpl *L) {
Kristof Umann30f08652018-06-18 11:50:17 +0000409 if (!L)
410 return;
411
412 printTail(Out, L->getTail());
Kristof Umann015b0592018-08-13 18:43:08 +0000413
414 L->getHead().printNode(Out);
415 L->getHead().printSeparator(Out);
Kristof Umann30f08652018-06-18 11:50:17 +0000416}
417
418//===----------------------------------------------------------------------===//
419// Utility functions.
420//===----------------------------------------------------------------------===//
421
Kristof Umanncc852442018-07-12 13:13:46 +0000422static Optional<nonloc::LazyCompoundVal>
Kristof Umann30f08652018-06-18 11:50:17 +0000423getObjectVal(const CXXConstructorDecl *CtorDecl, CheckerContext &Context) {
424
425 Loc ThisLoc = Context.getSValBuilder().getCXXThis(CtorDecl->getParent(),
426 Context.getStackFrame());
427 // Getting the value for 'this'.
428 SVal This = Context.getState()->getSVal(ThisLoc);
429
430 // Getting the value for '*this'.
431 SVal Object = Context.getState()->getSVal(This.castAs<Loc>());
432
433 return Object.getAs<nonloc::LazyCompoundVal>();
434}
435
Kristof Umann0735cfb2018-08-08 12:23:02 +0000436static bool willObjectBeAnalyzedLater(const CXXConstructorDecl *Ctor,
Kristof Umanna37bba42018-08-13 18:22:22 +0000437 CheckerContext &Context) {
Kristof Umann30f08652018-06-18 11:50:17 +0000438
Kristof Umann0735cfb2018-08-08 12:23:02 +0000439 Optional<nonloc::LazyCompoundVal> CurrentObject = getObjectVal(Ctor, Context);
440 if (!CurrentObject)
441 return false;
442
443 const LocationContext *LC = Context.getLocationContext();
444 while ((LC = LC->getParent())) {
445
446 // If \p Ctor was called by another constructor.
447 const auto *OtherCtor = dyn_cast<CXXConstructorDecl>(LC->getDecl());
448 if (!OtherCtor)
449 continue;
450
451 Optional<nonloc::LazyCompoundVal> OtherObject =
452 getObjectVal(OtherCtor, Context);
453 if (!OtherObject)
454 continue;
455
456 // If the CurrentObject is a subregion of OtherObject, it will be analyzed
457 // during the analysis of OtherObject.
458 if (CurrentObject->getRegion()->isSubRegionOf(OtherObject->getRegion()))
Kristof Umann30f08652018-06-18 11:50:17 +0000459 return true;
Kristof Umann30f08652018-06-18 11:50:17 +0000460 }
Kristof Umann0735cfb2018-08-08 12:23:02 +0000461
Kristof Umann30f08652018-06-18 11:50:17 +0000462 return false;
463}
464
Kristof Umann015b0592018-08-13 18:43:08 +0000465StringRef clang::ento::getVariableName(const FieldDecl *Field) {
Kristof Umann8c119092018-07-13 12:54:47 +0000466 // If Field is a captured lambda variable, Field->getName() will return with
467 // an empty string. We can however acquire it's name from the lambda's
468 // captures.
469 const auto *CXXParent = dyn_cast<CXXRecordDecl>(Field->getParent());
470
471 if (CXXParent && CXXParent->isLambda()) {
472 assert(CXXParent->captures_begin());
473 auto It = CXXParent->captures_begin() + Field->getFieldIndex();
474 return It->getCapturedVar()->getName();
475 }
476
477 return Field->getName();
478}
479
Kristof Umann30f08652018-06-18 11:50:17 +0000480void ento::registerUninitializedObjectChecker(CheckerManager &Mgr) {
481 auto Chk = Mgr.registerChecker<UninitializedObjectChecker>();
482 Chk->IsPedantic = Mgr.getAnalyzerOptions().getBooleanOption(
483 "Pedantic", /*DefaultVal*/ false, Chk);
Kristof Umann9bd44392018-06-29 11:25:24 +0000484 Chk->ShouldConvertNotesToWarnings = Mgr.getAnalyzerOptions().getBooleanOption(
485 "NotesAsWarnings", /*DefaultVal*/ false, Chk);
Kristof Umanna3f7b582018-08-07 12:55:26 +0000486 Chk->CheckPointeeInitialization = Mgr.getAnalyzerOptions().getBooleanOption(
487 "CheckPointeeInitialization", /*DefaultVal*/ false, Chk);
Kristof Umann30f08652018-06-18 11:50:17 +0000488}