LLVM API Documentation

llvm::SourceFile Class Reference

#include <SourceFile.h>

Collaboration diagram for llvm::SourceFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SourceFile (const std::string &fn, const GlobalVariable *Desc)
 ~SourceFile ()
const GlobalVariablegetDescriptor () const
const std::string & getFilename () const
void getSourceLine (unsigned LineNo, const char *&LineStart, const char *&LineEnd) const
unsigned getNumLines () const

Detailed Description

Definition at line 26 of file SourceFile.h.


Constructor & Destructor Documentation

llvm::SourceFile::SourceFile ( const std::string &  fn,
const GlobalVariable Desc 
) [inline]

SourceFile constructor - Read in the specified source file if it exists, but do not build the LineOffsets table until it is requested. This will NOT throw an exception if the file is not found, if there is an error reading it, or if the user cancels the operation. Instead, it will just be an empty source file.

Definition at line 52 of file SourceFile.h.

llvm::SourceFile::~SourceFile (  )  [inline]

Definition at line 56 of file SourceFile.h.

References llvm::sys::MappedFile::unmap().


Member Function Documentation

const GlobalVariable* llvm::SourceFile::getDescriptor (  )  const [inline]

getDescriptor - Return the debugging decriptor for this source file.

Definition at line 62 of file SourceFile.h.

const std::string& llvm::SourceFile::getFilename (  )  const [inline]

getFilename - Return the fully resolved path that this file was loaded from.

Definition at line 66 of file SourceFile.h.

References llvm::sys::Path::toString().

void SourceFile::getSourceLine ( unsigned  LineNo,
const char *&  LineStart,
const char *&  LineEnd 
) const

getSourceLine - Given a line number, return the start and end of the line in the file. If the line number is invalid, or if the file could not be loaded, null pointers are returned for the start and end of the file. Note that line numbers start with 0, not 1. This also strips off any newlines from the end of the line, to ease formatting of the text.

Definition at line 52 of file SourceFile.cpp.

References llvm::sys::MappedFile::charBase(), llvm::sys::MappedFile::isMapped(), and llvm::sys::MappedFile::size().

unsigned llvm::SourceFile::getNumLines (  )  const [inline]

getNumLines - Return the number of lines the source file contains.

Definition at line 78 of file SourceFile.h.


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