summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2011-06-01 13:10:15 +0000
committerJoerg Sonnenberger <joerg@bec.de>2011-06-01 13:10:15 +0000
commitaf5f23ee07d142d3405fc27b8d14d5d037a55c40 (patch)
tree99dacf237467be5c5eac72de9890ca0e8b978615 /llvm/lib
parent8b24a731f2740445a1e0faac56814270bd40ebf8 (diff)
downloadbcm5719-llvm-af5f23ee07d142d3405fc27b8d14d5d037a55c40.tar.gz
bcm5719-llvm-af5f23ee07d142d3405fc27b8d14d5d037a55c40.zip
Add new -d option to tblgen. It writes a make(1)-style dependency file.
llvm-svn: 132395
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp3
-rw-r--r--llvm/lib/Support/SourceMgr.cpp10
2 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index b89efd98649..2ba2fbd4b40 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -391,7 +391,8 @@ bool AsmParser::Error(SMLoc L, const Twine &Msg) {
}
bool AsmParser::EnterIncludeFile(const std::string &Filename) {
- int NewBuf = SrcMgr.AddIncludeFile(Filename, Lexer.getLoc());
+ std::string IncludedFile;
+ int NewBuf = SrcMgr.AddIncludeFile(Filename, Lexer.getLoc(), IncludedFile);
if (NewBuf == -1)
return true;
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp
index ef099163c22..de042a9f53c 100644
--- a/llvm/lib/Support/SourceMgr.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud