LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 25 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 53 of file SourceFile.h.

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

Definition at line 57 of file SourceFile.h.


Member Function Documentation

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

getDescriptor - Return the debugging decriptor for this source file.

Definition at line 63 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 67 of file SourceFile.h.

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

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

Definition at line 79 of file SourceFile.h.

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 93 of file SourceFile.cpp.


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