;
33 returnBodies[
D->getName()];
38 returnBodies[
D->getName()];
41voidModelInjector::onBodySynthesis(
const NamedDecl*
D) {
45 if(Bodies.count(
D->getName()) != 0)
49 FileIDmainFileID =
SM.getMainFileID();
55 if(!modelPath.empty())
57llvm::StringRef(modelPath.str() +
"/"+
D->getName().str() +
".model");
59fileName = llvm::StringRef(
D->getName().str() +
".model");
61 if(!llvm::sys::fs::exists(fileName.str())) {
62Bodies[
D->getName()] =
nullptr;
66 autoInvocation = std::make_shared<CompilerInvocation>(CI.
getInvocation());
70FrontendOpts.
Inputs.clear();
71FrontendOpts.
Inputs.emplace_back(fileName, IK);
74Invocation->getDiagnosticOpts().VerifyDiagnostics = 0;
79Instance.setInvocation(std::move(Invocation));
80Instance.createDiagnostics(
85Instance.getDiagnostics().setSourceManager(&
SM);
90Instance.setSourceManager(&
SM);
94Instance.getPreprocessor().InitializeForModelFile();
98llvm::CrashRecoveryContext CRC;
100CRC.RunSafelyOnThread([&]() { Instance.ExecuteAction(parseModelFile); },
103Instance.getPreprocessor().FinalizeForModelFile();
105Instance.resetAndLeakSourceManager();
106Instance.resetAndLeakFileManager();
107Instance.resetAndLeakPreprocessor();
113 SM.setMainFileID(mainFileID);
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
This file defines the clang::ento::ModelInjector class which implements the clang::CodeInjector inter...
Defines the clang::Preprocessor interface.
Defines utilities for dealing with stack allocation and stack space.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
DiagnosticConsumer & getDiagnosticClient() const
AnalyzerOptions & getAnalyzerOpts()
std::shared_ptr< Preprocessor > getPreprocessorPtr()
FileManager & getFileManager() const
Return the current file manager to the caller.
ASTContext & getASTContext() const
CompilerInvocation & getInvocation()
llvm::vfs::FileSystem & getVirtualFileSystem() const
std::shared_ptr< PCHContainerOperations > getPCHContainerOperations() const
SourceManager & getSourceManager() const
Return the current source manager.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Diagnostic consumer that forwards diagnostics along to an existing, already-initialized diagnostic co...
FrontendOptions - Options for controlling the behavior of the frontend.
unsigned DisableFree
Disable memory freeing on exit.
SmallVector< FrontendInputFile, 0 > Inputs
The input files and their types.
Represents a function declaration or definition.
The kind of a file that we've been handed as an input.
This represents a decl that may have a name.
ObjCMethodDecl - Represents an instance or class method declaration.
This class handles loading and caching of source files into memory.
Stmt - This represents one statement.
Stmt * getBody(const FunctionDecl *D) override
ModelInjector(CompilerInstance &CI)
Frontend action to parse model files.
The JSON file list parser is used to communicate input to InstallAPI.
constexpr size_t DesiredStackSize
The amount of stack space that Clang would like to be provided with.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4