aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode/Archive
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-22 18:02:52 +0000
committerChris Lattner <sabre@nondot.org>2003-04-22 18:02:52 +0000
commit75f20532ec768308767328a1234cbea38d115e6a (patch)
tree641aae08d612db6f1d92fd7d32421474b41affab /lib/Bytecode/Archive
parent37f59419b8680fd1814e71387c8354ad64bd670b (diff)
downloadexternal_llvm-75f20532ec768308767328a1234cbea38d115e6a.zip
external_llvm-75f20532ec768308767328a1234cbea38d115e6a.tar.gz
external_llvm-75f20532ec768308767328a1234cbea38d115e6a.tar.bz2
Preserve module source information in the ModuleID
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Archive')
-rw-r--r--lib/Bytecode/Archive/ArchiveReader.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Bytecode/Archive/ArchiveReader.cpp b/lib/Bytecode/Archive/ArchiveReader.cpp
index b6c3895..afa2c63 100644
--- a/lib/Bytecode/Archive/ArchiveReader.cpp
+++ b/lib/Bytecode/Archive/ArchiveReader.cpp
@@ -82,7 +82,8 @@ static bool ParseLongFilenameSection(unsigned char *Buffer, unsigned Size,
}
-static bool ReadArchiveBuffer(unsigned char *Buffer, unsigned Length,
+static bool ReadArchiveBuffer(const std::string &Filename,
+ unsigned char *Buffer, unsigned Length,
std::vector<Module*> &Objects,
std::string *ErrorStr) {
if (Length < 8 || memcmp(Buffer, "!<arch>\n", 8))
@@ -107,7 +108,8 @@ static bool ReadArchiveBuffer(unsigned char *Buffer, unsigned Length,
return true;
break;
case UserObject: {
- Module *M = ParseBytecodeBuffer(Buffer+sizeof(ar_hdr), Size, ErrorStr);
+ Module *M = ParseBytecodeBuffer(Buffer+sizeof(ar_hdr), Size,
+ Filename+":somefile", ErrorStr);
if (!M) return true;
Objects.push_back(M);
break;
@@ -151,7 +153,7 @@ bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
return Error(ErrorStr, "Error mmapping file!");
// Parse the archive files we mmap'ped in
- bool Result = ReadArchiveBuffer(Buffer, Length, Objects, ErrorStr);
+ bool Result = ReadArchiveBuffer(Filename, Buffer, Length, Objects, ErrorStr);
// Unmmap the archive...
munmap((char*)Buffer, Length);