diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2011-06-01 13:10:15 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2011-06-01 13:10:15 +0000 |
commit | dd137903e47fdb5822724baaddae88f119badc86 (patch) | |
tree | 51531c32ef74bc1e35f52107db196d04dffaf681 /lib/Support/SourceMgr.cpp | |
parent | b6fbec3a546fd04bb2e79040db2436b0bd629162 (diff) |
Add new -d option to tblgen. It writes a make(1)-style dependency file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SourceMgr.cpp')
-rw-r--r-- | lib/Support/SourceMgr.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index ef099163c2..de042a9f53 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -49,14 +49,16 @@ SourceMgr::~SourceMgr() { /// directory or in one of the IncludeDirs. If no file is found, this returns /// ~0, otherwise it returns the buffer ID of the stacked file. unsigned SourceMgr::AddIncludeFile(const std::string &Filename, - SMLoc IncludeLoc) { + SMLoc IncludeLoc, + std::string &IncludedFile) { OwningPtr<MemoryBuffer> NewBuf; - MemoryBuffer::getFile(Filename.c_str(), NewBuf); + IncludedFile = Filename; + MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf); // If the file didn't exist directly, see if it's in an include path. for (unsigned i = 0, e = IncludeDirectories.size(); i != e && !NewBuf; ++i) { - std::string IncFile = IncludeDirectories[i] + "/" + Filename; - MemoryBuffer::getFile(IncFile.c_str(), NewBuf); + IncludedFile = IncludeDirectories[i] + "/" + Filename; + MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf); } if (NewBuf == 0) return ~0U; |