//==- NonnullGlobalConstantsChecker.cpp ---------------------------*- C++ -*--//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This checker adds an assumption that constant globals of certain types* are
// non-null, as otherwise they generally do not convey any useful information.
// The assumption is useful, as many framework use e. g. global const strings,
// and the analyzer might not be able to infer the global value if the
// definition is in a separate translation unit.
// The following types (and their typedef aliases) are considered to be
// non-null:
// - `char* const`
// - `const CFStringRef` from CoreFoundation
// - `NSString* const` from Foundation
// - `CFBooleanRef` from Foundation
//
//===----------------------------------------------------------------------===//
using namespace clang;
using namespace ento;
// namespace
/// Lazily initialize cache for required identifier information.
void
/// Add an assumption that const string-like globals are non-null.
void
/// \param V loaded lvalue.
/// \return whether @c val is a string-like const global.
bool
/// \return whether @c type is extremely unlikely to be null
bool
void
bool