clang 20.0.0git
Namespaces | Functions
ErrnoModeling.cpp File Reference
#include "ErrnoModeling.h"
#include "clang/AST/ParentMapContext.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FormatVariadic.h"
#include <optional>

Go to the source code of this file.

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::ento
 
namespace  clang::ento::errno_modeling
 

Functions

std::optional< SValclang::ento::errno_modeling::getErrnoValue (ProgramStateRef State)
 Returns the value of 'errno', if 'errno' was found in the AST.
 
ProgramStateRef clang::ento::errno_modeling::setErrnoValue (ProgramStateRef State, const LocationContext *LCtx, SVal Value, ErrnoCheckState EState)
 Set value of 'errno' to any SVal, if possible.
 
ProgramStateRef clang::ento::errno_modeling::setErrnoValue (ProgramStateRef State, CheckerContext &C, uint64_t Value, ErrnoCheckState EState)
 Set value of 'errno' to a concrete (signed) integer, if possible.
 
std::optional< Locclang::ento::errno_modeling::getErrnoLoc (ProgramStateRef State)
 Returns the location that points to the MemoryRegion where the 'errno' value is stored.
 
ErrnoCheckState clang::ento::errno_modeling::getErrnoState (ProgramStateRef State)
 Returns the errno check state, Errno_Irrelevant if 'errno' was not found (this is not the only case for that value).
 
ProgramStateRef clang::ento::errno_modeling::setErrnoState (ProgramStateRef State, ErrnoCheckState EState)
 Set the errno check state, do not modify the errno value.
 
ProgramStateRef clang::ento::errno_modeling::clearErrnoState (ProgramStateRef State)
 Clear state of errno (make it irrelevant).
 
bool clang::ento::errno_modeling::isErrnoLocationCall (const CallEvent &Call)
 Determine if Call is a call to an internal function that returns the location of errno (in environments where errno is accessed this way).
 
const NoteTagclang::ento::errno_modeling::getErrnoNoteTag (CheckerContext &C, const std::string &Message)
 Create a NoteTag that displays the message if the 'errno' memory region is marked as interesting, and resets the interestingness.
 
ProgramStateRef clang::ento::errno_modeling::setErrnoForStdSuccess (ProgramStateRef State, CheckerContext &C)
 Set errno state for the common case when a standard function is successful.
 
ProgramStateRef clang::ento::errno_modeling::setErrnoForStdFailure (ProgramStateRef State, CheckerContext &C, NonLoc ErrnoSym)
 Set errno state for the common case when a standard function fails.
 
ProgramStateRef clang::ento::errno_modeling::setErrnoStdMustBeChecked (ProgramStateRef State, CheckerContext &C, const Expr *InvalE)
 Set errno state for the common case when a standard function indicates failure only by errno.