LLVM API Documentation
#include <SourceFile.h>
Public Member Functions | |
| SourceFile (const std::string &fn, const GlobalVariable *Desc) | |
| ~SourceFile () | |
| const GlobalVariable * | getDescriptor () const |
| const std::string & | getFilename () const |
| void | getSourceLine (unsigned LineNo, const char *&LineStart, const char *&LineEnd) const |
| unsigned | getNumLines () const |
Definition at line 27 of file SourceFile.h.
| SourceFile::SourceFile | ( | const std::string & | fn, | |
| const GlobalVariable * | Desc | |||
| ) |
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 21 of file SourceFile.cpp.
References EmptyFile, llvm::MemoryBuffer::getFileOrSTDIN(), and llvm::MemoryBuffer::getMemBuffer().
| SourceFile::~SourceFile | ( | ) |
Definition at line 30 of file SourceFile.cpp.
| const GlobalVariable* llvm::SourceFile::getDescriptor | ( | ) | const [inline] |
getDescriptor - Return the debugging decriptor for this source file.
Definition at line 59 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 63 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.
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.
Definition at line 61 of file SourceFile.cpp.
| unsigned llvm::SourceFile::getNumLines | ( | ) | const [inline] |
getNumLines - Return the number of lines the source file contains.
Definition at line 75 of file SourceFile.h.