mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
For PR351: \
* Get file information from a MappedFile instance \ * Convert file type tests to sys::Path form git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -170,11 +170,16 @@ SourceFileInfo::~SourceFileInfo() {
|
||||
|
||||
SourceFile &SourceFileInfo::getSourceText() const {
|
||||
// FIXME: this should take into account the source search directories!
|
||||
if (SourceText == 0) // Read the file in if we haven't already.
|
||||
if (!Directory.empty() && FileOpenable(Directory+"/"+BaseName))
|
||||
SourceText = new SourceFile(Directory+"/"+BaseName, Descriptor);
|
||||
if (SourceText == 0) { // Read the file in if we haven't already.
|
||||
sys::Path tmpPath;
|
||||
if (!Directory.empty())
|
||||
tmpPath.setDirectory(Directory);
|
||||
tmpPath.appendFile(BaseName);
|
||||
if (tmpPath.readable())
|
||||
SourceText = new SourceFile(tmpPath.toString(), Descriptor);
|
||||
else
|
||||
SourceText = new SourceFile(BaseName, Descriptor);
|
||||
}
|
||||
return *SourceText;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user