|
clang 24.0.0git
|
Namespaces | |
| namespace | ErrorMessages |
Classes | |
| class | AnalysisBase |
| Minimal common base for both analysis kinds. More... | |
| class | AnalysisDriver |
| Orchestrates whole-program analysis over an LUSummary. More... | |
| class | AnalysisName |
| Uniquely identifies a whole-program analysis and the AnalysisResult it produces. More... | |
| class | AnalysisResult |
| Base class for whole-program analysis results. More... | |
| class | BuildNamespace |
| Represents a single namespace in the build process. More... | |
| struct | CallGraphSummary |
| Summary of direct call-graph edges for a single function entity. More... | |
| class | DerivedAnalysis |
| Typed intermediate that concrete derived analyses inherit from. More... | |
| class | DerivedAnalysisBase |
| Type-erased base for derived analyses. More... | |
| class | EntityId |
| Lightweight opaque handle representing an entity in an EntityIdTable. More... | |
| class | EntityIdTable |
| Manages entity name interning and provides efficient EntityId handles. More... | |
| class | EntityLinkage |
| Represents the linkage properties of an entity in the program model. More... | |
| class | EntityLinker |
| class | EntityName |
| Uniquely identifies an entity in a program. More... | |
| class | EntityPointerLevelTranslator |
| class | EntitySourceLocationsSummary |
| An EntitySourceLocationsSummary contains one SourceLocationRecord per declaration site contributed by an entity. More... | |
| class | EntitySummary |
| Base class for analysis-specific summary data. More... | |
| class | EntitySummaryEncoding |
| Represents EntitySummary data in its serialized, format-specific encoding. More... | |
| class | ErrorBuilder |
| Fluent API for constructing contextual errors. More... | |
| struct | FormatFile |
| struct | FormatInfoEntry |
| struct | HasAnalysisName |
Type trait that checks whether T has a static analysisName() method returning AnalysisName. More... | |
| struct | HasAnalysisName< T, std::void_t< decltype(T::analysisName())> > |
| struct | HasSummaryName |
Type trait that checks whether T has a static summaryName() method returning SummaryName. More... | |
| struct | HasSummaryName< T, std::void_t< decltype(T::summaryName())> > |
| class | JSONEntitySummaryEncoding |
| class | JSONFormat |
| class | LUSummary |
| Represents a link unit (LU) summary containing merged entity summaries. More... | |
| class | LUSummaryConsumer |
| Consumes a LUSummary by dispatching its entity data to registered SummaryDataBuilders and returning the results in a SummaryDataStore. More... | |
| class | LUSummaryEncoding |
| Represents a link unit summary in its serialized encoding. More... | |
| class | MultiArchSharedLibrary |
| Represents a multi-architecture shared library. More... | |
| class | MultiArchStaticLibrary |
| Represents a multi-architecture static library. More... | |
| class | NestedBuildNamespace |
| Represents a hierarchical sequence of build namespaces. More... | |
| struct | PointerFlowAnalysisResult |
| The whole-program pointer-flow graph. More... | |
| class | PointerFlowEntitySummary |
| struct | ReportDocument |
| struct | ReportResult |
| class | SerializationFormat |
| Abstract base class for serialization formats. More... | |
| class | SourceEditEmitter |
| struct | SourceLocationRecord |
| A canonical (file, line, column) triple for one declaration site. More... | |
| class | SourceTransformationFrontendAction |
Wraps the existing FrontendAction and runs the source-transformation pipeline alongside it. More... | |
| class | SSAFOptions |
| class | StaticLibrary |
| Represents a static library of translation unit summary encodings. More... | |
| class | SummaryAnalysis |
| Typed intermediate that concrete summary analyses inherit from. More... | |
| class | SummaryAnalysisBase |
| Type-erased base for summary analyses. More... | |
| class | SummaryData |
| Base class for whole-program analysis data. More... | |
| class | SummaryDataBuilder |
| Typed intermediate template that concrete builders inherit from. More... | |
| class | SummaryDataBuilderBase |
| Abstract base class for all summary data builders. More... | |
| class | SummaryDataStore |
| Owns a collection of SummaryData objects keyed by SummaryName. More... | |
| class | SummaryName |
| Uniquely identifies an analysis summary. More... | |
| class | Transformation |
| class | TransformationReportEmitter |
| class | TUSummary |
| Data extracted for a given translation unit and for a given set of analyses. More... | |
| class | TUSummaryBuilder |
| class | TUSummaryEncoding |
| Represents a translation unit summary in its serialized encoding. More... | |
| class | TUSummaryExtractor |
| class | TUSummaryExtractorFrontendAction |
Wraps the existing FrontendAction and injects the extractor ASTConsumers into the pipeline after the ASTConsumers of the wrapped action. More... | |
| struct | TypeConstrainedPointersAnalysisResult |
| Whole-program set of pointer entities that must retain their pointer type. More... | |
| struct | TypeConstrainedPointersEntitySummary |
| Per-contributor set of pointer entities that must retain their pointer type. More... | |
| struct | UnsafeBufferReachableAnalysisResult |
| struct | UnsafeBufferUsageAnalysisResult |
| class | UnsafeBufferUsageEntitySummary |
| An UnsafeBufferUsageEntitySummary contains a set of EntityPointerLevels extracted from unsafe buffer pointers contributed by an entity. More... | |
| class | UnsafeBufferUsageTUSummaryExtractor |
| class | WPASuite |
| Bundles the EntityIdTable (moved from the LUSummary) and the analysis results produced by one AnalysisDriver::run() call, keyed by AnalysisName. More... | |
Typedefs | |
| using | EdgeSet = std::map<EntityPointerLevel, EntityPointerLevelSet> |
| Maps each LHS pointer (source / assignee) to the set of RHS pointers (destinations / assigned values) at static assignment sites. | |
| using | Artifact = std::variant<TUSummary, LUSummary, WPASuite> |
Sum type returned by SerializationFormat::readArtifact, used when the caller does not know up-front which kind of top-level SSAF artifact a file contains. | |
| using | ArtifactEncoding |
Lazily-deserialized counterpart of Artifact: the same on-disk artifacts but with their per-entity summary payloads left as opaque format-specific encodings rather than fully resolved analysis results. | |
| using | SerializationFormatRegistry = llvm::Registry<SerializationFormat> |
| template<typename Derived> | |
| using | DerivesFromEntitySummary |
| using | TUSummaryExtractorRegistry |
| using | TransformationRegistry |
| using | Array = llvm::json::Array |
| using | Object = llvm::json::Object |
| using | Value = llvm::json::Value |
Enumerations | |
| enum class | BuildNamespaceKind : unsigned short { CompilationUnit , LinkUnit , StaticLibrary , MultiArchStaticLibrary } |
| enum class | EntityLinkageType { None , Internal , External } |
Functions | |
| EntityPointerLevel | incrementPointerLevel (const EntityPointerLevel &E) |
| An EntityPointerLevel is associated with a level of the declared pointer/array type of an entity. | |
| llvm::json::Value | entityPointerLevelToJSON (const EntityPointerLevel &EPL, JSONFormat::EntityIdToJSONFn EntityId2JSON) |
| Expected< EntityPointerLevel > | entityPointerLevelFromJSON (const llvm::json::Value &EPLData, JSONFormat::EntityIdFromJSONFn EntityIdFromJSON) |
| llvm::json::Array | entityPointerLevelSetToJSON (llvm::iterator_range< EntityPointerLevelSet::const_iterator > EPLs, JSONFormat::EntityIdToJSONFn EntityId2JSON) |
| Expected< EntityPointerLevelSet > | entityPointerLevelSetFromJSON (const llvm::json::Array &EPLsData, JSONFormat::EntityIdFromJSONFn EntityIdFromJSON) |
| llvm::json::Array | entityPointerLevelMapToJSON (const std::map< EntityId, EntityPointerLevelSet > &Map, JSONFormat::EntityIdToJSONFn IdToJSON) |
| Serialize a map<EntityId, EntityPointerLevelSet> as a flat array of alternating [EntityId, EntityPointerLevelSet, ...] pairs. | |
| Expected< std::map< EntityId, EntityPointerLevelSet > > | entityPointerLevelMapFromJSON (const llvm::json::Array &Content, JSONFormat::EntityIdFromJSONFn IdFromJSON) |
| Deserialize a flat array of alternating [EntityId, EntityPointerLevelSet, ...] pairs into a map. | |
| llvm::json::Array | edgeSetToJSON (llvm::iterator_range< EdgeSet::const_iterator > Edges, JSONFormat::EntityIdToJSONFn IdToJSON) |
| Serialize an EdgeSet {(src1, dest1), (src1, dest2), (src2, dest3), (src2, dest4), ...} to an array of arrays of EntityPointerLevels: [ [src1, dest1, dest2, ...], [src2, dest3, dest4, ...], ... ]. | |
| llvm::Expected< EdgeSet > | edgeSetFromJSON (const llvm::json::Array &EdgesData, JSONFormat::EntityIdFromJSONFn IdFromJSON) |
| Deserialize an EdgeSet from the array format produced by edgeSetToJSON. | |
| std::optional< EntityName > | getEntityName (const Decl *D) |
| Maps a declaration to an EntityName. | |
| std::optional< EntityName > | getEntityNameForReturn (const FunctionDecl *FD) |
| Maps return entity of a function to an EntityName. | |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, BuildNamespaceKind BNK) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const BuildNamespace &BN) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const NestedBuildNamespace &NBN) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const EntityId &Id) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, EntityLinkageType Linkage) |
| Writes a string representation of the linkage type to the stream. | |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const EntityLinkage &Linkage) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const EntityName &EN) |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SummaryName &SN) |
| bool | isFormatRegistered (llvm::StringRef FormatName) |
| Check if a SerializationFormat was registered with a given name. | |
| std::unique_ptr< SerializationFormat > | makeFormat (llvm::StringRef FormatName) |
| Try to instantiate a SerializationFormat with a given name. | |
| void | printAvailableFormats (llvm::raw_ostream &OS) |
| Print the list of available serialization formats. | |
| bool | isTUSummaryExtractorRegistered (llvm::StringRef SummaryName) |
| Check if a TUSummaryExtractor was registered with a given name. | |
| std::unique_ptr< TUSummaryExtractor > | makeTUSummaryExtractor (llvm::StringRef SummaryName, TUSummaryBuilder &Builder) |
| Try to instantiate a TUSummaryExtractor with a given name. | |
| void | printAvailableTUSummaryExtractors (llvm::raw_ostream &OS) |
| Print the list of available TUSummaryExtractors. | |
| llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const AnalysisName &AN) |
| llvm::Error | writeSARIFTransformationReport (const ReportDocument &Doc, llvm::StringRef Path) |
Writes Doc to Path as a SARIF JSON document. | |
| bool | isTransformationRegistered (llvm::StringRef Name) |
| Check if a Transformation was registered with a given name. | |
| std::unique_ptr< Transformation > | makeTransformation (llvm::StringRef Name, const WPASuite &Suite, SourceEditEmitter &Edits, TransformationReportEmitter &Report) |
| Try to instantiate a Transformation with a given name. | |
| void | printAvailableTransformations (llvm::raw_ostream &OS) |
| Print the list of available Transformations. | |
| llvm::Error | writeYAMLSourceEdits (const clang::tooling::TranslationUnitReplacements &Doc, llvm::StringRef Path) |
Writes Doc to Path as a YAML document compatible with clang-apply-replacements. | |
| llvm::StringRef | getToolName () |
| Returns the name of the running tool, as set by initTool(). | |
| void | fail (const char *Msg) |
| template<typename... Ts> | |
| void | fail (const char *Fmt, Ts &&...Args) |
| void | fail (llvm::Error Err) |
| void | loadPlugins (llvm::ArrayRef< std::string > Paths) |
| void | initTool (int argc, const char **argv, llvm::StringRef Version, llvm::cl::OptionCategory &Category, llvm::StringRef ToolHeading) |
| Sets ToolName, ToolVersion, and the version printer, hides unrelated command-line options, and parses arguments. | |
| PointerFlowEntitySummary | buildPointerFlowEntitySummary (EdgeSet Edges) |
| EntitySourceLocationsSummary | buildEntitySourceLocationsSummary (std::vector< SourceLocationRecord > Locs) |
| llvm::ArrayRef< SourceLocationRecord > | getDeclLocations (const EntitySourceLocationsSummary &S) |
| std::string | describeJSONValue (const llvm::json::Value &V) |
| std::string | describeJSONValue (const llvm::json::Array &A) |
| std::string | describeJSONValue (const llvm::json::Object &O) |
| template<typename NodeTy, typename... Ts> | |
| llvm::Error | makeErrAtNode (clang::ASTContext &Ctx, const NodeTy *N, llvm::StringRef Fmt, const Ts &...Args) |
| template<typename JSONTy, typename... Ts> | |
| llvm::Error | makeSawButExpectedError (const JSONTy &Saw, llvm::StringRef Expected, const Ts &...ExpectedArgs) |
| bool | hasPtrOrArrType (const Expr *E) |
| bool | hasPtrOrArrType (const ValueDecl *D) |
| llvm::Error | makeEntityNameErr (clang::ASTContext &Ctx, const clang::NamedDecl *D) |
| void | logWarningFromError (llvm::Error Err) |
| Log a warning from an llvm::Error. | |
| void | findContributors (ASTContext &Ctx, const SSAFOptions &Options, llvm::DenseMap< const NamedDecl *, std::vector< const NamedDecl * > > &Contributors, bool ExtractFromSystemHeaders=true) |
| Find all contributors in an AST. | |
| void | findMatchesIn (const NamedDecl *Contributor, llvm::function_ref< void(const DynTypedNode &)> MatchActionRef) |
| Perform "MatchAction" on each Stmt and Decl belonging to the Contributor. | |
| template<typename ExtractorFnT> | |
| void | extractAndAddSummaries (TUSummaryExtractor &Extractor, TUSummaryBuilder &Builder, ASTContext &Ctx, ExtractorFnT ExtractFn, llvm::StringRef ExtractorName="") |
| The standard contributor-summary extraction procedure: | |
| llvm::StringRef | buildNamespaceKindToString (BuildNamespaceKind BNK) |
Returns the canonical string representation of BNK used for serialization and display (e.g. | |
| std::optional< BuildNamespaceKind > | buildNamespaceKindFromString (llvm::StringRef Str) |
| Parses a string produced by buildNamespaceKindToString(). | |
| llvm::StringRef | entityLinkageTypeToString (EntityLinkageType LT) |
Returns the canonical string representation of LT used for serialization and display (e.g. | |
| std::optional< EntityLinkageType > | entityLinkageTypeFromString (llvm::StringRef Str) |
| Parses a string produced by entityLinkageTypeToString(). | |
| llvm::Expected< Value > | readJSON (llvm::StringRef Path) |
| llvm::Error | writeJSON (Value &&V, llvm::StringRef Path) |
| SummaryName | summaryNameFromJSON (llvm::StringRef SummaryNameStr) |
| llvm::StringRef | summaryNameToJSON (const SummaryName &SN) |
| llvm::Expected< llvm::StringRef > | readSummaryType (const Object &RootObject) |
Reads the JSONTypeKey field from the root object as a string. | |
| llvm::Error | checkSummaryType (const Object &RootObject, llvm::StringRef ExpectedType) |
Reads the JSONTypeKey field from the root object and verifies it equals ExpectedType. | |
| AnalysisName | analysisNameFromJSON (llvm::StringRef AnalysisNameStr) |
| llvm::StringRef | analysisNameToJSON (const AnalysisName &AN) |
| llvm::Expected< BuildNamespaceKind > | buildNamespaceKindFromJSON (llvm::StringRef BuildNamespaceKindStr) |
| llvm::StringRef | buildNamespaceKindToJSON (BuildNamespaceKind BNK) |
| static llvm::Expected< std::pair< llvm::StringRef, llvm::StringRef > > | entityNameCoreFromJSON (const Object &EntityNameObject) |
| Reads "usr" and "suffix" fields from an EntityName JSON object. | |
| llvm::Expected< EntityLinkageType > | entityLinkageTypeFromJSON (llvm::StringRef EntityLinkageTypeStr) |
| llvm::StringRef | entityLinkageTypeToJSON (EntityLinkageType LT) |
| llvm::Error | validateNormalizedTargetTriple (llvm::StringRef Triple) |
Validates that Triple is a target triple string in normalized form. | |
| static llvm::Expected< EntityId > | entityIdTableEntryIdFromJSON (const Object &EntityIdTableEntryObject, llvm::function_ref< EntityId(uint64_t)> MakeId) |
| Shared logic for reading the "id" field from an EntityIdTableEntry object. | |
| static llvm::Expected< EntityIdTable > | entityIdTableFromJSONImpl (const Array &EntityIdTableArray, llvm::function_ref< llvm::Expected< std::pair< EntityName, EntityId > >(const Object &)> EntryReader, llvm::function_ref< std::map< EntityName, EntityId > &(EntityIdTable &)> GetEntities) |
| Shared logic for deserializing an EntityIdTable from a JSON array. | |
Variables | |
| constexpr llvm::StringLiteral | PointerFlowAnalysisResultName |
| constexpr llvm::StringLiteral | UnsafeBufferUsageAnalysisResultName |
| constexpr llvm::StringLiteral | UnsafeBufferReachableAnalysisResultName |
| template<typename T> | |
| constexpr bool | HasSummaryName_v = HasSummaryName<T>::value |
| template<typename T> | |
| constexpr bool | HasAnalysisName_v = HasAnalysisName<T>::value |
| static const int | BuiltinAnchorDestination |
| volatile int | CallGraphExtractorAnchorSource = 0 |
| volatile int | CallGraphJSONFormatAnchorSource = 0 |
| volatile int | PointerFlowAnalysisAnchorSource = 0 |
| volatile int | PointerFlowExtractorAnchorSource = 0 |
| volatile int | PointerFlowJSONFormatAnchorSource = 0 |
| volatile int | EntitySourceLocationExtractorAnchorSource = 0 |
| volatile int | SharedLexicalRepresentationJSONFormatAnchorSource = 0 |
| volatile int | TypeConstrainedPointersAnchorSource = 0 |
| volatile int | UnsafeBufferUsageAnalysisAnchorSource = 0 |
| volatile int | UnsafeBufferUsageExtractorAnchorSource = 0 |
| volatile int | UnsafeBufferUsageJSONFormatAnchorSource = 0 |
| volatile int | JSONFormatAnchorSource = 0 |
| constexpr const char * | JSONFormatFileExtension = ".json" |
| constexpr const char * | JSONEntityIdKey = "@" |
| An entity ID is encoded as the single-key object {"@": <index>}. | |
| constexpr const char * | JSONTypeKey = "type" |
| Root-object key naming the summary kind so files are self-describing. | |
| constexpr const char * | JSONTypeValueTUSummary = "TUSummary" |
Value written to JSONTypeKey for serialized TUSummary files. | |
| constexpr const char * | JSONTypeValueLUSummary = "LUSummary" |
Value written to JSONTypeKey for serialized LUSummary files. | |
| constexpr const char * | JSONTypeValueStaticLibrary = "StaticLibrary" |
Value written to JSONTypeKey for serialized StaticLibrary files. | |
| constexpr const char * | JSONTypeValueMultiArchStaticLibrary |
Value written to JSONTypeKey for serialized MultiArchStaticLibrary files. | |
| constexpr const char * | JSONTypeValueMultiArchSharedLibrary |
Value written to JSONTypeKey for serialized MultiArchSharedLibrary files. | |
| constexpr const char * | JSONTypeValueWPASuite = "WPASuite" |
Value written to JSONTypeKey for serialized WPASuite files. | |
| static constexpr llvm::StringLiteral | ErrorSeparator = " + " |
| static constexpr llvm::StringLiteral | ContextSeparator = "\n" |
| volatile int | AnalysisRegistryAnchorSource = 0 |
| volatile int | SSAFSourceTransformationAnchorSource = 0 |
| using clang::ssaf::Array = llvm::json::Array |
Definition at line 37 of file JSONFormatImpl.h.
| using clang::ssaf::Artifact = std::variant<TUSummary, LUSummary, WPASuite> |
Sum type returned by SerializationFormat::readArtifact, used when the caller does not know up-front which kind of top-level SSAF artifact a file contains.
The active alternative is decided by the file's self-describing type field.
Definition at line 41 of file SerializationFormat.h.
Lazily-deserialized counterpart of Artifact: the same on-disk artifacts but with their per-entity summary payloads left as opaque format-specific encodings rather than fully resolved analysis results.
StaticLibrary, MultiArchStaticLibrary, and MultiArchSharedLibrary appear only in this variant: the archiver/arch tools and the linker pass member payloads through without decoding them, so fully decoded shapes would have no consumer.
Definition at line 51 of file SerializationFormat.h.
| using clang::ssaf::DerivesFromEntitySummary |
Definition at line 25 of file EntitySummary.h.
| using clang::ssaf::EdgeSet = std::map<EntityPointerLevel, EntityPointerLevelSet> |
Maps each LHS pointer (source / assignee) to the set of RHS pointers (destinations / assigned values) at static assignment sites.
Definition at line 24 of file PointerFlow.h.
| using clang::ssaf::Object = llvm::json::Object |
Definition at line 38 of file JSONFormatImpl.h.
| using clang::ssaf::SerializationFormatRegistry = llvm::Registry<SerializationFormat> |
Definition at line 83 of file SerializationFormatRegistry.h.
Definition at line 58 of file TransformationRegistry.h.
Definition at line 49 of file ExtractorRegistry.h.
| using clang::ssaf::Value = llvm::json::Value |
Definition at line 39 of file JSONFormatImpl.h.
|
strong |
| Enumerator | |
|---|---|
| CompilationUnit | |
| LinkUnit | |
| StaticLibrary | |
| MultiArchStaticLibrary | |
Definition at line 30 of file BuildNamespace.h.
|
strong |
| Enumerator | |
|---|---|
| None | local variables |
| Internal | static functions/variables, anonymous namespace |
| External | globally visible across translation units (including parameters of functions with external linkage) |
Definition at line 17 of file EntityLinkage.h.
| AnalysisName clang::ssaf::analysisNameFromJSON | ( | llvm::StringRef | AnalysisNameStr | ) |
Definition at line 186 of file JSONFormatImpl.cpp.
| llvm::StringRef clang::ssaf::analysisNameToJSON | ( | const AnalysisName & | AN | ) |
Definition at line 190 of file JSONFormatImpl.cpp.
References clang::ssaf::AnalysisName::str().
|
extern |
Definition at line 29 of file SharedLexicalRepresentationFormat.cpp.
Referenced by deserialize().
| llvm::Expected< BuildNamespaceKind > clang::ssaf::buildNamespaceKindFromJSON | ( | llvm::StringRef | BuildNamespaceKindStr | ) |
Definition at line 243 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), buildNamespaceKindFromString(), clang::ssaf::ErrorBuilder::create(), and clang::ssaf::ErrorMessages::InvalidBuildNamespaceKind.
|
inline |
Parses a string produced by buildNamespaceKindToString().
Returns std::nullopt if Str does not match any known BuildNamespaceKind value.
Definition at line 50 of file ModelStringConversions.h.
References CompilationUnit, LinkUnit, MultiArchStaticLibrary, and StaticLibrary.
Referenced by buildNamespaceKindFromJSON().
| llvm::StringRef clang::ssaf::buildNamespaceKindToJSON | ( | BuildNamespaceKind | BNK | ) |
Definition at line 256 of file JSONFormatImpl.cpp.
References buildNamespaceKindToString().
|
inline |
Returns the canonical string representation of BNK used for serialization and display (e.g.
"CompilationUnit", "LinkUnit").
Definition at line 33 of file ModelStringConversions.h.
References CompilationUnit, LinkUnit, MultiArchStaticLibrary, and StaticLibrary.
Referenced by buildNamespaceKindToJSON(), and operator<<().
|
extern |
Definition at line 15 of file PointerFlow.cpp.
Referenced by summaryFromJSON().
| llvm::Error clang::ssaf::checkSummaryType | ( | const Object & | RootObject, |
| llvm::StringRef | ExpectedType ) |
Reads the JSONTypeKey field from the root object and verifies it equals ExpectedType.
Returns success or an error with the field missing/mismatch detail.
Definition at line 167 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), JSONTypeKey, clang::ssaf::ErrorMessages::MismatchedSummaryType, and readSummaryType().
Referenced by clang::ssaf::JSONFormat::readLUSummary(), clang::ssaf::JSONFormat::readLUSummaryEncoding(), clang::ssaf::JSONFormat::readMultiArchSharedLibrary(), clang::ssaf::JSONFormat::readMultiArchStaticLibrary(), clang::ssaf::JSONFormat::readStaticLibrary(), clang::ssaf::JSONFormat::readTUSummary(), clang::ssaf::JSONFormat::readTUSummaryEncoding(), and clang::ssaf::JSONFormat::readWPASuite().
| std::string clang::ssaf::describeJSONValue | ( | const llvm::json::Array & | A | ) |
Definition at line 26 of file SSAFAnalysesCommon.cpp.
| std::string clang::ssaf::describeJSONValue | ( | const llvm::json::Object & | O | ) |
Definition at line 30 of file SSAFAnalysesCommon.cpp.
| std::string clang::ssaf::describeJSONValue | ( | const llvm::json::Value & | V | ) |
Definition at line 22 of file SSAFAnalysesCommon.cpp.
References V.
Referenced by makeSawButExpectedError().
| llvm::Expected< EdgeSet > clang::ssaf::edgeSetFromJSON | ( | const llvm::json::Array & | EdgesData, |
| JSONFormat::EntityIdFromJSONFn | IdFromJSON ) |
Deserialize an EdgeSet from the array format produced by edgeSetToJSON.
Definition at line 56 of file PointerFlowFormat.cpp.
References entityPointerLevelFromJSON(), and makeSawButExpectedError().
Referenced by summaryFromJSON().
| Array clang::ssaf::edgeSetToJSON | ( | llvm::iterator_range< EdgeSet::const_iterator > | Edges, |
| JSONFormat::EntityIdToJSONFn | IdToJSON ) |
Serialize an EdgeSet {(src1, dest1), (src1, dest2), (src2, dest3), (src2, dest4), ...} to an array of arrays of EntityPointerLevels: [ [src1, dest1, dest2, ...], [src2, dest3, dest4, ...], ... ].
Definition at line 40 of file PointerFlowFormat.cpp.
References entityPointerLevelToJSON().
Referenced by summaryToJSON().
|
static |
Shared logic for reading the "id" field from an EntityIdTableEntry object.
Definition at line 497 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), and clang::ssaf::ErrorMessages::FailedToReadObjectAtField.
|
static |
Shared logic for deserializing an EntityIdTable from a JSON array.
EntryReader is called for each entry object to produce an (EntityName, EntityId) pair.
Definition at line 602 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::context(), clang::ssaf::ErrorBuilder::create(), clang::ssaf::ErrorMessages::FailedInsertionOnDuplication, clang::ssaf::ErrorMessages::FailedToReadObjectAtIndex, clang::ssaf::ErrorMessages::ReadingFromIndex, and clang::ssaf::ErrorBuilder::wrap().
| llvm::Expected< EntityLinkageType > clang::ssaf::entityLinkageTypeFromJSON | ( | llvm::StringRef | EntityLinkageTypeStr | ) |
Definition at line 430 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), entityLinkageTypeFromString(), and clang::ssaf::ErrorMessages::InvalidEntityLinkageType.
|
inline |
Parses a string produced by entityLinkageTypeToString().
Returns std::nullopt if Str does not match any known EntityLinkageType value.
Definition at line 83 of file ModelStringConversions.h.
References External, Internal, and None.
Referenced by entityLinkageTypeFromJSON().
| llvm::StringRef clang::ssaf::entityLinkageTypeToJSON | ( | EntityLinkageType | LT | ) |
Definition at line 442 of file JSONFormatImpl.cpp.
References entityLinkageTypeToString().
|
inline |
Returns the canonical string representation of LT used for serialization and display (e.g.
"None", "Internal", "External").
Definition at line 68 of file ModelStringConversions.h.
References External, Internal, and None.
Referenced by entityLinkageTypeToJSON(), and operator<<().
|
static |
Reads "usr" and "suffix" fields from an EntityName JSON object.
Shared core logic for both TU and LU entity name deserialization.
Definition at line 353 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), and clang::ssaf::ErrorMessages::FailedToReadObjectAtField.
| llvm::Expected< EntityPointerLevel > clang::ssaf::entityPointerLevelFromJSON | ( | const llvm::json::Value & | EPLData, |
| JSONFormat::EntityIdFromJSONFn | EntityIdFromJSON ) |
Definition at line 30 of file EntityPointerLevelFormat.cpp.
References makeSawButExpectedError().
Referenced by deserializeImpl(), edgeSetFromJSON(), and entityPointerLevelSetFromJSON().
| Expected< std::map< EntityId, EntityPointerLevelSet > > clang::ssaf::entityPointerLevelMapFromJSON | ( | const llvm::json::Array & | Content, |
| JSONFormat::EntityIdFromJSONFn | IdFromJSON ) |
Deserialize a flat array of alternating [EntityId, EntityPointerLevelSet, ...] pairs into a map.
Definition at line 99 of file EntityPointerLevelFormat.cpp.
References entityPointerLevelSetFromJSON(), makeSawButExpectedError(), and clang::Result.
| llvm::json::Array clang::ssaf::entityPointerLevelMapToJSON | ( | const std::map< EntityId, EntityPointerLevelSet > & | Map, |
| JSONFormat::EntityIdToJSONFn | IdToJSON ) |
Serialize a map<EntityId, EntityPointerLevelSet> as a flat array of alternating [EntityId, EntityPointerLevelSet, ...] pairs.
Definition at line 86 of file EntityPointerLevelFormat.cpp.
References entityPointerLevelSetToJSON().
| Expected< EntityPointerLevelSet > clang::ssaf::entityPointerLevelSetFromJSON | ( | const llvm::json::Array & | EPLsData, |
| JSONFormat::EntityIdFromJSONFn | EntityIdFromJSON ) |
Definition at line 70 of file EntityPointerLevelFormat.cpp.
References entityPointerLevelFromJSON().
Referenced by entityPointerLevelMapFromJSON().
| llvm::json::Array clang::ssaf::entityPointerLevelSetToJSON | ( | llvm::iterator_range< EntityPointerLevelSet::const_iterator > | EPLs, |
| JSONFormat::EntityIdToJSONFn | EntityId2JSON ) |
Definition at line 60 of file EntityPointerLevelFormat.cpp.
References entityPointerLevelToJSON(), and clang::Result.
Referenced by entityPointerLevelMapToJSON().
| llvm::json::Value clang::ssaf::entityPointerLevelToJSON | ( | const EntityPointerLevel & | EPL, |
| JSONFormat::EntityIdToJSONFn | EntityId2JSON ) |
Definition at line 24 of file EntityPointerLevelFormat.cpp.
Referenced by edgeSetToJSON(), entityPointerLevelSetToJSON(), and serialize().
| void clang::ssaf::extractAndAddSummaries | ( | TUSummaryExtractor & | Extractor, |
| TUSummaryBuilder & | Builder, | ||
| ASTContext & | Ctx, | ||
| ExtractorFnT | ExtractFn, | ||
| llvm::StringRef | ExtractorName = "" ) |
The standard contributor-summary extraction procedure:
Extract to get an EntitySummary of a contributor from all of its decls.Builder.| ExtractorFnT | the template parameter that should be a function type 'std::unique_ptr<SummaryT>(std::vector<const NamedDecl *>)' for different entity summary type SummaryTs |
| ExtractFn | The function that extracts summaries of a contributor from its decls. |
| ExtractorName | The optional information inserted into the warning message when duplicate contributor names (EntityNames) are seen. |
Definition at line 115 of file SSAFAnalysesCommon.h.
References clang::ssaf::TUSummaryExtractor::addEntity(), clang::ssaf::SSAFOptions::ExtractFromSystemHeaders, findContributors(), clang::ssaf::TUSummaryExtractor::getOptions(), logWarningFromError(), makeEntityNameErr(), and makeErrAtNode().
Referenced by clang::ssaf::UnsafeBufferUsageTUSummaryExtractor::HandleTranslationUnit().
|
inline |
| void clang::ssaf::fail | ( | const char * | Msg | ) |
Definition at line 127 of file Utils.cpp.
References noreturn.
Referenced by fail(), fail(), clang::ssaf::FormatFile::fromInputPath(), clang::ssaf::FormatFile::fromOutputPath(), and loadPlugins().
| void clang::ssaf::fail | ( | llvm::Error | Err | ) |
| void clang::ssaf::findContributors | ( | ASTContext & | Ctx, |
| const SSAFOptions & | Options, | ||
| llvm::DenseMap< const NamedDecl *, std::vector< const NamedDecl * > > & | Contributors, | ||
| bool | ExtractFromSystemHeaders = true ) |
Find all contributors in an AST.
The found contributors are organized as a map from the canonical declaration of each entity to all of its declarations.
Options controls which declarations qualify as contributors. By default the visitor preserves the original SSAF behavior of skipping block-scope (function-local) variable declarations; setting Options.IncludeLocalEntities to true also collects local variables (excluding function parameters, which are addressed via their parent function's USR).
Definition at line 163 of file SSAFAnalysesCommon.cpp.
References clang::C, and clang::cast().
Referenced by extractAndAddSummaries().
| void clang::ssaf::findMatchesIn | ( | const NamedDecl * | Contributor, |
| llvm::function_ref< void(const DynTypedNode &)> | MatchActionRef ) |
Perform "MatchAction" on each Stmt and Decl belonging to the Contributor.
| Contributor | |
| MatchActionRef | a reference (view) to a "MatchAction" |
Definition at line 174 of file SSAFAnalysesCommon.cpp.
Referenced by clang::ssaf::UnsafeBufferUsageTUSummaryExtractor::extractEntitySummary().
| llvm::ArrayRef< SourceLocationRecord > clang::ssaf::getDeclLocations | ( | const EntitySourceLocationsSummary & | S | ) |
Definition at line 34 of file SharedLexicalRepresentationFormat.cpp.
Referenced by serialize().
| std::optional< EntityName > clang::ssaf::getEntityName | ( | const Decl * | D | ) |
Maps a declaration to an EntityName.
Supported declaration types for entity mapping:
Implicit declarations and compiler builtins are not mapped.
| D | The declaration to map. Must not be null. |
Definition at line 21 of file ASTEntityMapping.cpp.
References clang::cast(), clang::index::generateUSRForDecl(), clang::isa(), and clang::Decl::isImplicit().
Referenced by clang::ssaf::TUSummaryExtractor::addEntity().
| std::optional< EntityName > clang::ssaf::getEntityNameForReturn | ( | const FunctionDecl * | FD | ) |
Maps return entity of a function to an EntityName.
The returned name uniquely identifies the return value of function
| FD. | |
| FD | The function declaration. Must not be null. |
Definition at line 62 of file ASTEntityMapping.cpp.
References clang::index::generateUSRForDecl(), clang::FunctionDecl::getBuiltinID(), and clang::Decl::isImplicit().
Referenced by clang::ssaf::TUSummaryExtractor::addEntityForReturn().
| llvm::StringRef clang::ssaf::getToolName | ( | ) |
Returns the name of the running tool, as set by initTool().
Definition at line 58 of file SSAFAnalysesCommon.h.
References clang::QualType::getCanonicalType(), and clang::Expr::getType().
Definition at line 64 of file SSAFAnalysesCommon.h.
References clang::QualType::getCanonicalType(), clang::QualType::getNonReferenceType(), and clang::ValueDecl::getType().
| EntityPointerLevel clang::ssaf::incrementPointerLevel | ( | const EntityPointerLevel & | E | ) |
An EntityPointerLevel is associated with a level of the declared pointer/array type of an entity.
In the fully-expanded spelling of the declared type, a EntityPointerLevel is associated with a '*' (or a '[]‘) in / that declaration. / / For example, for 'int *p[10];’, there are two EntityPointerLevels. / One is associated with 'int *[10]' of 'p' and the other is associated with / 'int *' of 'p'. / / An EntityPointerLevel can be identified by an EntityId and an unsigned / integer indicating the pointer level: '(EntityId, PointerLevel)'. / An EntityPointerLevel 'P' is valid iff 'P.EntityId' has a pointer type with / at least 'P.PointerLevel' levels (This implies 'P.PointerLevel > 0'). / / For the same example 'int *p[10];', the EntityPointerLevels below are valid: / - '(p, 2)' is associated with the 'int *' part of the declared type of 'p'; / - '(p, 1)' is associated with the 'int *[10]' part of the declared type of / 'p'. class EntityPointerLevel { EntityId Entity; unsigned PointerLevel;
friend class EntityPointerLevelTranslator; For unittests: friend EntityPointerLevel buildEntityPointerLevel(EntityId, unsigned);
explicit EntityPointerLevel(std::pair<EntityId, unsigned> Pair) : Entity(Pair.first), PointerLevel(Pair.second) {}
public: EntityId getEntity() const { return Entity; } unsigned getPointerLevel() const { return PointerLevel; }
bool operator==(const EntityPointerLevel &Other) const { return std::tie(Entity, PointerLevel) == std::tie(Other.Entity, Other.PointerLevel); }
bool operator!=(const EntityPointerLevel &Other) const { return !(*this == Other); }
bool operator<(const EntityPointerLevel &Other) const { return std::tie(Entity, PointerLevel) < std::tie(Other.Entity, Other.PointerLevel); }
/ Compares EntityPointerLevels; additionally, partially compares / EntityPointerLevel with EntityId. struct Comparator { using is_transparent = void; bool operator()(const EntityPointerLevel &L, const EntityPointerLevel &R) const { return L < R; } bool operator()(const EntityId &L, const EntityPointerLevel &R) const { return L < R.getEntity(); } bool operator()(const EntityPointerLevel &L, const EntityId &R) const { return L.getEntity() < R; } }; };
using EntityPointerLevelSet = std::set<EntityPointerLevel, EntityPointerLevel::Comparator>;
/ Translate a pointer/array type expression 'E' to a (set of) / EntityPointerLevel(s) associated with the declared type of the base address / of E. If the base address of E is not associated with an entity, the / translation result is an empty set. / /
| E | the pointer expression to be translated / |
| Ctx | the AST context of E / |
| AddEntity | the callback provided by the caller to convert EntityNames / to EntityIds. llvm::Expected<EntityPointerLevelSet> translateEntityPointerLevel(const Expr *E, ASTContext &Ctx, TUSummaryExtractor &Extractor); |
/ Creates a EntityPointerLevel from a pair of an EntityId and a pointer / level: EntityPointerLevel buildEntityPointerLevel(EntityId, unsigned);
/ Create an EntityPointerLevel (EPL) from a NamedDecl of a pointer/array type. / /
| ND | the NamedDecl of a pointer/array type. / |
| AddEntity | the callback provided by the caller to convert EntityNames / to EntityIds. / |
| IsFunRet | true iff the created EPL is associated with the return type / of a function entity. llvm::Expected<EntityPointerLevel> createEntityPointerLevel(const NamedDecl *ND, TUSummaryExtractor &Extractor, bool IsFunRet = false); |
/ Creates a new EntityPointerLevel (EPL) from E by incrementing E's / pointer level. /
Definition at line 359 of file EntityPointerLevel.cpp.
References clang::ssaf::EntityPointerLevelTranslator::incrementPointerLevel().
| void clang::ssaf::initTool | ( | int | argc, |
| const char ** | argv, | ||
| llvm::StringRef | Version, | ||
| llvm::cl::OptionCategory & | Category, | ||
| llvm::StringRef | ToolHeading ) |
| bool clang::ssaf::isFormatRegistered | ( | llvm::StringRef | FormatName | ) |
Check if a SerializationFormat was registered with a given name.
Definition at line 17 of file SerializationFormatRegistry.cpp.
References isFormatRegistered().
Referenced by isFormatRegistered(), and parseOutputFileFormatAndPathOrReportError().
| bool clang::ssaf::isTransformationRegistered | ( | llvm::StringRef | Name | ) |
Check if a Transformation was registered with a given name.
Definition at line 22 of file TransformationRegistry.cpp.
References isTransformationRegistered().
Referenced by isTransformationRegistered().
| bool clang::ssaf::isTUSummaryExtractorRegistered | ( | llvm::StringRef | SummaryName | ) |
Check if a TUSummaryExtractor was registered with a given name.
Referenced by makeTUSummaryExtractors(), and reportUnrecognizedExtractorNames().
| void clang::ssaf::loadPlugins | ( | llvm::ArrayRef< std::string > | Paths | ) |
|
inline |
Log a warning from an llvm::Error.
Definition at line 73 of file SSAFAnalysesCommon.h.
Referenced by extractAndAddSummaries(), and clang::ssaf::UnsafeBufferUsageTUSummaryExtractor::extractEntitySummary().
| llvm::Error clang::ssaf::makeEntityNameErr | ( | clang::ASTContext & | Ctx, |
| const clang::NamedDecl * | D ) |
Definition at line 180 of file SSAFAnalysesCommon.cpp.
References clang::NamedDecl::getNameAsString(), and makeErrAtNode().
Referenced by extractAndAddSummaries().
| llvm::Error clang::ssaf::makeErrAtNode | ( | clang::ASTContext & | Ctx, |
| const NodeTy * | N, | ||
| llvm::StringRef | Fmt, | ||
| const Ts &... | Args ) |
Definition at line 41 of file SSAFAnalysesCommon.h.
References clang::ASTContext::getSourceManager().
Referenced by extractAndAddSummaries(), makeEntityNameErr(), and clang::ssaf::EntityPointerLevelTranslator::translate().
| std::unique_ptr< SerializationFormat > clang::ssaf::makeFormat | ( | llvm::StringRef | FormatName | ) |
Try to instantiate a SerializationFormat with a given name.
This might return null if the construction of the desired SerializationFormat failed. It's a fatal error if there is no format registered with the name.
Definition at line 25 of file SerializationFormatRegistry.cpp.
| llvm::Error clang::ssaf::makeSawButExpectedError | ( | const JSONTy & | Saw, |
| llvm::StringRef | Expected, | ||
| const Ts &... | ExpectedArgs ) |
Definition at line 49 of file SSAFAnalysesCommon.h.
References describeJSONValue().
Referenced by deserialize(), deserializeImpl(), edgeSetFromJSON(), entityPointerLevelFromJSON(), entityPointerLevelMapFromJSON(), sourceLocationRecordFromJSON(), and summaryFromJSON().
| std::unique_ptr< Transformation > clang::ssaf::makeTransformation | ( | llvm::StringRef | Name, |
| const WPASuite & | Suite, | ||
| SourceEditEmitter & | Edits, | ||
| TransformationReportEmitter & | Report ) |
Try to instantiate a Transformation with a given name.
This might return null if the construction of the desired Transformation failed. It's a fatal error if there is no transformation registered with the name.
Definition at line 30 of file TransformationRegistry.cpp.
References clang::sema::Report.
| std::unique_ptr< TUSummaryExtractor > clang::ssaf::makeTUSummaryExtractor | ( | llvm::StringRef | SummaryName, |
| TUSummaryBuilder & | Builder ) |
Try to instantiate a TUSummaryExtractor with a given name.
This might return null if the construction of the desired TUSummaryExtractor failed. It's a fatal error if there is no extractor registered with the name.
Definition at line 27 of file ExtractorRegistry.cpp.
Referenced by makeTUSummaryExtractors().
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| BuildNamespaceKind | BNK ) |
Definition at line 57 of file BuildNamespace.cpp.
References buildNamespaceKindToString().
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const AnalysisName & | AN ) |
Definition at line 13 of file AnalysisName.cpp.
References clang::ssaf::AnalysisName::str().
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const BuildNamespace & | BN ) |
Definition at line 61 of file BuildNamespace.cpp.
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const EntityId & | Id ) |
Definition at line 13 of file EntityId.cpp.
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const EntityLinkage & | Linkage ) |
Definition at line 28 of file EntityLinkage.cpp.
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const EntityName & | EN ) |
Definition at line 36 of file EntityName.cpp.
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const NestedBuildNamespace & | NBN ) |
Definition at line 65 of file BuildNamespace.cpp.
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| const SummaryName & | SN ) |
Definition at line 13 of file SummaryName.cpp.
References clang::ssaf::SummaryName::str().
| llvm::raw_ostream & clang::ssaf::operator<< | ( | llvm::raw_ostream & | OS, |
| EntityLinkageType | Linkage ) |
Writes a string representation of the linkage type to the stream.
Definition at line 23 of file EntityLinkage.cpp.
References entityLinkageTypeToString().
| void clang::ssaf::printAvailableFormats | ( | llvm::raw_ostream & | OS | ) |
Print the list of available serialization formats.
Definition at line 33 of file SerializationFormatRegistry.cpp.
Referenced by clang::driver::Driver::HandleImmediateArgs().
| void clang::ssaf::printAvailableTransformations | ( | llvm::raw_ostream & | OS | ) |
Print the list of available Transformations.
Definition at line 40 of file TransformationRegistry.cpp.
| void clang::ssaf::printAvailableTUSummaryExtractors | ( | llvm::raw_ostream & | OS | ) |
Print the list of available TUSummaryExtractors.
Definition at line 36 of file ExtractorRegistry.cpp.
Referenced by clang::driver::Driver::HandleImmediateArgs().
| llvm::Expected< Value > clang::ssaf::readJSON | ( | llvm::StringRef | Path | ) |
Definition at line 35 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), clang::ssaf::ErrorMessages::FailedToReadFile, clang::ssaf::ErrorMessages::FileIsDirectory, clang::ssaf::ErrorMessages::FileIsNotJSON, clang::ssaf::ErrorMessages::FileNotFound, and JSONFormatFileExtension.
Referenced by clang::ssaf::JSONFormat::readArtifact(), clang::ssaf::JSONFormat::readArtifactEncoding(), clang::ssaf::JSONFormat::readLUSummary(), clang::ssaf::JSONFormat::readLUSummaryEncoding(), clang::ssaf::JSONFormat::readMultiArchSharedLibrary(), clang::ssaf::JSONFormat::readMultiArchStaticLibrary(), clang::ssaf::JSONFormat::readStaticLibrary(), clang::ssaf::JSONFormat::readTUSummary(), clang::ssaf::JSONFormat::readTUSummaryEncoding(), and clang::ssaf::JSONFormat::readWPASuite().
| llvm::Expected< llvm::StringRef > clang::ssaf::readSummaryType | ( | const Object & | RootObject | ) |
Reads the JSONTypeKey field from the root object as a string.
Returns the string on success; on error, the message is suitable for callers that want to report the missing field themselves.
Definition at line 156 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), clang::ssaf::ErrorMessages::FailedToReadObjectAtField, and JSONTypeKey.
Referenced by checkSummaryType(), clang::ssaf::JSONFormat::readArtifact(), and clang::ssaf::JSONFormat::readArtifactEncoding().
| SummaryName clang::ssaf::summaryNameFromJSON | ( | llvm::StringRef | SummaryNameStr | ) |
Definition at line 146 of file JSONFormatImpl.cpp.
| llvm::StringRef clang::ssaf::summaryNameToJSON | ( | const SummaryName & | SN | ) |
Definition at line 150 of file JSONFormatImpl.cpp.
References clang::ssaf::SummaryName::str().
| llvm::Error clang::ssaf::validateNormalizedTargetTriple | ( | llvm::StringRef | Triple | ) |
Validates that Triple is a target triple string in normalized form.
Returns success if Triple equals llvm::Triple::normalize(Triple), otherwise returns an invalid_argument error describing the expected normalized form.
Definition at line 450 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), and clang::ssaf::ErrorMessages::TargetTripleNotNormalized.
| llvm::Error clang::ssaf::writeJSON | ( | Value && | V, |
| llvm::StringRef | Path ) |
Definition at line 69 of file JSONFormatImpl.cpp.
References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), clang::ssaf::ErrorMessages::FailedToWriteFile, clang::ssaf::ErrorMessages::FileExists, clang::ssaf::ErrorMessages::FileIsNotJSON, JSONFormatFileExtension, clang::ssaf::ErrorMessages::ParentDirectoryNotFound, and V.
Referenced by clang::ssaf::JSONFormat::writeLUSummary(), clang::ssaf::JSONFormat::writeLUSummaryEncoding(), clang::ssaf::JSONFormat::writeMultiArchSharedLibrary(), clang::ssaf::JSONFormat::writeMultiArchStaticLibrary(), clang::ssaf::JSONFormat::writeStaticLibrary(), clang::ssaf::JSONFormat::writeTUSummary(), clang::ssaf::JSONFormat::writeTUSummaryEncoding(), and clang::ssaf::JSONFormat::writeWPASuite().
| llvm::Error clang::ssaf::writeSARIFTransformationReport | ( | const ReportDocument & | Doc, |
| llvm::StringRef | Path ) |
Writes Doc to Path as a SARIF JSON document.
Definition at line 22 of file SARIFTransformationReportFormat.cpp.
References clang::SarifDocumentWriter::appendResult(), clang::SarifResult::create(), clang::SarifRule::create(), clang::SarifDocumentWriter::createDocument(), clang::SarifDocumentWriter::createRule(), clang::SarifDocumentWriter::createRun(), clang::Result, clang::ssaf::ReportDocument::Results, clang::SarifResult::setDiagnosticLevel(), clang::SarifResult::setDiagnosticMessage(), clang::SarifResult::setRuleId(), clang::ssaf::ReportDocument::SM, and clang::ssaf::ReportDocument::TransformationName.
| llvm::Error clang::ssaf::writeYAMLSourceEdits | ( | const clang::tooling::TranslationUnitReplacements & | Doc, |
| llvm::StringRef | Path ) |
Writes Doc to Path as a YAML document compatible with clang-apply-replacements.
Definition at line 19 of file YAMLSourceEditFormat.cpp.
| volatile int clang::ssaf::AnalysisRegistryAnchorSource = 0 |
Definition at line 18 of file AnalysisRegistry.cpp.
|
static |
Definition at line 29 of file SSAFBuiltinForceLinker.h.
| volatile int clang::ssaf::CallGraphExtractorAnchorSource = 0 |
Definition at line 113 of file CallGraphExtractor.cpp.
| volatile int clang::ssaf::CallGraphJSONFormatAnchorSource = 0 |
Definition at line 173 of file CallGraphJSONFormat.cpp.
|
staticconstexpr |
Definition at line 17 of file ErrorBuilder.cpp.
Referenced by clang::ssaf::ErrorBuilder::build().
| volatile int clang::ssaf::EntitySourceLocationExtractorAnchorSource = 0 |
Definition at line 182 of file EntitySourceLocationExtractor.cpp.
|
staticconstexpr |
Definition at line 16 of file ErrorBuilder.cpp.
Referenced by clang::ssaf::ErrorBuilder::wrap().
|
inlineconstexpr |
Definition at line 32 of file AnalysisTraits.h.
Referenced by clang::ssaf::WPASuite::contains(), and clang::ssaf::WPASuite::get().
|
inlineconstexpr |
Definition at line 37 of file SummaryDataTraits.h.
Referenced by clang::ssaf::SummaryDataStore::contains(), clang::ssaf::SummaryDataStore::get(), and clang::ssaf::SummaryDataStore::take().
|
inlineconstexpr |
An entity ID is encoded as the single-key object {"@": <index>}.
Definition at line 140 of file JSONFormatImpl.h.
| volatile int clang::ssaf::JSONFormatAnchorSource = 0 |
Definition at line 29 of file JSONFormatImpl.cpp.
|
inlineconstexpr |
Definition at line 45 of file JSONFormatImpl.h.
Referenced by readJSON(), and writeJSON().
|
inlineconstexpr |
Root-object key naming the summary kind so files are self-describing.
Definition at line 147 of file JSONFormatImpl.h.
Referenced by checkSummaryType(), clang::ssaf::JSONFormat::readArtifact(), clang::ssaf::JSONFormat::readArtifactEncoding(), readSummaryType(), clang::ssaf::JSONFormat::writeLUSummary(), clang::ssaf::JSONFormat::writeMultiArchSharedLibrary(), clang::ssaf::JSONFormat::writeMultiArchStaticLibrary(), clang::ssaf::JSONFormat::writeTUSummary(), and clang::ssaf::JSONFormat::writeWPASuite().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized LUSummary files.
Definition at line 153 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifact(), clang::ssaf::JSONFormat::readArtifactEncoding(), clang::ssaf::JSONFormat::readLUSummary(), clang::ssaf::JSONFormat::readLUSummaryEncoding(), and clang::ssaf::JSONFormat::writeLUSummary().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized MultiArchSharedLibrary files.
Definition at line 165 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifactEncoding(), clang::ssaf::JSONFormat::readMultiArchSharedLibrary(), and clang::ssaf::JSONFormat::writeMultiArchSharedLibrary().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized MultiArchStaticLibrary files.
Definition at line 160 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifactEncoding(), clang::ssaf::JSONFormat::readMultiArchStaticLibrary(), and clang::ssaf::JSONFormat::writeMultiArchStaticLibrary().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized StaticLibrary files.
Definition at line 156 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifactEncoding(), and clang::ssaf::JSONFormat::readStaticLibrary().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized TUSummary files.
Definition at line 150 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifact(), clang::ssaf::JSONFormat::readArtifactEncoding(), clang::ssaf::JSONFormat::readTUSummary(), clang::ssaf::JSONFormat::readTUSummaryEncoding(), and clang::ssaf::JSONFormat::writeTUSummary().
|
inlineconstexpr |
Value written to JSONTypeKey for serialized WPASuite files.
Definition at line 169 of file JSONFormatImpl.h.
Referenced by clang::ssaf::JSONFormat::readArtifact(), clang::ssaf::JSONFormat::readWPASuite(), and clang::ssaf::JSONFormat::writeWPASuite().
| volatile int clang::ssaf::PointerFlowAnalysisAnchorSource = 0 |
Definition at line 121 of file PointerFlowAnalysis.cpp.
|
constexpr |
Definition at line 26 of file PointerFlowAnalysis.h.
Referenced by clang::ssaf::PointerFlowAnalysisResult::analysisName().
| volatile int clang::ssaf::PointerFlowExtractorAnchorSource = 0 |
Definition at line 348 of file PointerFlowExtractor.cpp.
| volatile int clang::ssaf::PointerFlowJSONFormatAnchorSource = 0 |
Definition at line 131 of file PointerFlowFormat.cpp.
| volatile int clang::ssaf::SharedLexicalRepresentationJSONFormatAnchorSource = 0 |
Definition at line 127 of file SharedLexicalRepresentationFormat.cpp.
| volatile int clang::ssaf::SSAFSourceTransformationAnchorSource = 0 |
Definition at line 17 of file TransformationRegistry.cpp.
| volatile int clang::ssaf::TypeConstrainedPointersAnchorSource = 0 |
Definition at line 260 of file TypeConstrainedPointers.cpp.
|
constexpr |
Definition at line 37 of file UnsafeBufferUsageAnalysis.h.
Referenced by clang::ssaf::UnsafeBufferReachableAnalysisResult::analysisName().
| volatile int clang::ssaf::UnsafeBufferUsageAnalysisAnchorSource = 0 |
Definition at line 249 of file UnsafeBufferUsageAnalysis.cpp.
|
constexpr |
Definition at line 35 of file UnsafeBufferUsageAnalysis.h.
Referenced by clang::ssaf::UnsafeBufferUsageAnalysisResult::analysisName().
| volatile int clang::ssaf::UnsafeBufferUsageExtractorAnchorSource = 0 |
Definition at line 87 of file UnsafeBufferUsageExtractor.cpp.
| volatile int clang::ssaf::UnsafeBufferUsageJSONFormatAnchorSource = 0 |
Definition at line 85 of file UnsafeBufferUsageFormat.cpp.