Remove using declarations
[oota-llvm.git] / lib / Archive / ArchiveReader.cpp
index b6c389523f4b1481a240ee86edd5a631aac9ea3d..450fd04587601bac156d6b3fa2b8898c6e62d693 100644 (file)
@@ -3,7 +3,7 @@
 // This file implements the ReadArchiveFile interface, which allows a linker to
 // read all of the LLVM bytecode files contained in a .a file.  This file
 // understands the standard system .a file format.  This can only handle the .a
-// variant prevelant on linux systems so far, but may be extended.  See
+// variant prevalent on Linux systems so far, but may be extended.  See
 // information in this source file for more information:
 //   http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/archive.c?cvsroot=src
 //
@@ -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);