LLVM API Documentation

llvm::ProgramInfo Class Reference

#include <ProgramInfo.h>

Collaboration diagram for llvm::ProgramInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProgramInfo (Module *m)
 ~ProgramInfo ()
sys::TimeValue getProgramTimeStamp () const
const SourceFileInfogetSourceFile (const GlobalVariable *Desc)
const SourceFileInfogetSourceFile (const std::string &Filename)
const std::map< const GlobalVariable *,
SourceFileInfo * > & 
getSourceFiles (bool RequiresCompleteMap=true)
const SourceFunctionInfogetFunction (const GlobalVariable *Desc)
const std::map< const GlobalVariable *,
SourceFunctionInfo * > & 
getSourceFunctions (bool RequiresCompleteMap=true)
bool allSourceFunctionsRead () const
template<typename SL>
SL::CacheTypegetLanguageCache (const SL *L)

Detailed Description

ProgramInfo - This object contains information about the loaded program. When a new program is loaded, an instance of this class is created. When the program is unloaded, the instance is destroyed. This object basically manages the lazy computation of information useful for the debugger.

Definition at line 132 of file ProgramInfo.h.


Constructor & Destructor Documentation

ProgramInfo::ProgramInfo ( Module m  ) 

Definition at line 197 of file ProgramInfo.cpp.

References llvm::Module::getModuleIdentifier().

ProgramInfo::~ProgramInfo (  ) 

Definition at line 206 of file ProgramInfo.cpp.

References E, I, and second.


Member Function Documentation

bool llvm::ProgramInfo::allSourceFunctionsRead (  )  const [inline]

addSourceFunctionsRead - Return true if the source functions map is complete: that is, all functions in the program have been read in.

Definition at line 226 of file ProgramInfo.h.

const SourceFunctionInfo & ProgramInfo::getFunction ( const GlobalVariable Desc  ) 

getFunction - Return source function information for the specified function descriptor object, adding it to the collection as needed. This method always succeeds (is unambiguous), and is always efficient.

Definition at line 320 of file ProgramInfo.cpp.

References llvm::SourceLanguage::createSourceFunctionInfo(), llvm::GlobalVariable::getInitializer(), getSourceFile(), GV, and llvm::GlobalVariable::hasInitializer().

Referenced by getSourceFunctions().

template<typename SL>
SL::CacheType& llvm::ProgramInfo::getLanguageCache ( const SL *  L  )  [inline]

getLanguageCache - This method is used to build per-program caches of information, such as the functions or types visible to the program. This can be used by SourceLanguage implementations because it requires an accessible [sl]CacheType typedef, where [sl] is the C++ type of the source-language subclass.

Definition at line 234 of file ProgramInfo.h.

References first, and second.

sys::TimeValue llvm::ProgramInfo::getProgramTimeStamp (  )  const [inline]

getProgramTimeStamp - Return the time-stamp of the program when it was loaded.

Definition at line 174 of file ProgramInfo.h.

const SourceFileInfo & ProgramInfo::getSourceFile ( const std::string &  Filename  ) 

getSourceFile - Look up the file with the specified name. If there is more than one match for the specified filename, prompt the user to pick one. If there is no source file that matches the specified name, throw an exception indicating that we can't find the file. Otherwise, return the file information for that file.

If the source file hasn't been discovered yet in the program, this method might have to index the whole program by calling the getSourceFiles() method.

Definition at line 296 of file ProgramInfo.cpp.

References getSourceFiles(), and llvm::tie().

const SourceFileInfo & ProgramInfo::getSourceFile ( const GlobalVariable Desc  ) 

getSourceFile - Return source file information for the specified source file descriptor object, adding it to the collection as needed. This method always succeeds (is unambiguous), and is always efficient.

Definition at line 230 of file ProgramInfo.cpp.

References llvm::SourceLanguage::createSourceFileInfo(), llvm::SourceLanguage::get(), llvm::GlobalVariable::getInitializer(), and llvm::GlobalVariable::hasInitializer().

Referenced by getFunction(), getSourceFiles(), llvm::StackFrame::getSourceLocation(), and llvm::SourceFunctionInfo::SourceFunctionInfo().

const std::map< const GlobalVariable *, SourceFileInfo * > & ProgramInfo::getSourceFiles ( bool  RequiresCompleteMap = true  ) 

getSourceFiles - Index all of the source files in the program and return them. This information is lazily computed the first time that it is requested. Since this information can take a long time to compute, the user is given a chance to cancel it. If this occurs, an exception is thrown.

Definition at line 259 of file ProgramInfo.cpp.

References llvm::StructType::get(), llvm::Module::getGlobalVariable(), getGlobalVariablesUsing(), getSourceFile(), and llvm::SlowOperationInformer::progress().

Referenced by getSourceFile().

const std::map< const GlobalVariable *, SourceFunctionInfo * > & ProgramInfo::getSourceFunctions ( bool  RequiresCompleteMap = true  ) 

getSourceFunctions - Index all of the functions in the program and return them. This information is lazily computed the first time that it is requested. Since this information can take a long time to compute, the user is given a chance to cancel it. If this occurs, an exception is thrown.

Definition at line 343 of file ProgramInfo.cpp.

References Functions, llvm::StructType::get(), getFunction(), llvm::Module::getGlobalVariable(), getGlobalVariablesUsing(), and llvm::SlowOperationInformer::progress().


The documentation for this class was generated from the following files: