delete mapfile;
mapfile = 0;
base = 0;
-
+
// Forget the entire symbol table
symTab.clear();
symTabSize = 0;
-
+
firstFileOffset = 0;
-
+
// Free the foreign symbol table member
if (foreignST) {
delete foreignST;
foreignST = 0;
}
-
+
// Delete any Modules and ArchiveMember's we've allocated as a result of
// symbol table searches.
for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) {
if (!GI->isDeclaration() && !GI->hasLocalLinkage())
if (!GI->getName().empty())
symbols.push_back(GI->getName());
-
+
// Loop over functions
for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
if (!FI->isDeclaration() && !FI->hasLocalLinkage())
+ ec.message();
return true;
}
-
+
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M)
return true;
-
+
// Get the symbols
getSymbols(M, symbols);
-
+
// Done with the module.
delete M;
return true;
// Get the module.
OwningPtr<MemoryBuffer> Buffer(
MemoryBuffer::getMemBufferCopy(StringRef(BufPtr, Length),ModuleID.c_str()));
-
+
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M)
return 0;
-
+
// Get the symbols
getSymbols(M, symbols);
-
+
// Done with the module. Note that it's the caller's responsibility to delete
// the Module.
return M;
// Insert a file into the archive before some other member. This also takes care
// of extracting the necessary flags and information from the file.
bool
-Archive::addFileBefore(const sys::Path& filePath, iterator where,
+Archive::addFileBefore(const sys::Path& filePath, iterator where,
std::string* ErrMsg) {
bool Exists;
if (sys::fs::exists(filePath.str(), Exists) || !Exists) {
std::vector<std::string> symbols;
std::string FullMemberName = archPath.str() + "(" + member.getPath().str()
+ ")";
- Module* M =
+ Module* M =
GetBitcodeSymbols(data, fSize, FullMemberName, Context, symbols, ErrMsg);
// If the bitcode parsed successfully
}
const char* base = arch->getBufferStart();
- // Open another temporary file in order to avoid invalidating the
+ // Open another temporary file in order to avoid invalidating the
// mmapped data
if (FinalFilePath.createTemporaryFileOnDisk(ErrMsg))
return true;
// Close up shop
FinalFile.close();
} // free arch.
-
+
// Move the final file over top of TmpArchive
if (FinalFilePath.renamePathOnDisk(TmpArchive, ErrMsg))
return true;
}
-
+
// Before we replace the actual archive, we need to forget all the
// members, since they point to data in that old archive. We need to do
// this because we cannot replace an open file on Windows.
cleanUpMemory();
-
+
if (TmpArchive.renamePathOnDisk(archPath, ErrMsg))
return true;
// finds with all the files in that directory (recursively). It uses the
// sys::Path::getDirectoryContent method to perform the actual directory scans.
bool
-recurseDirectories(const sys::Path& path,
+recurseDirectories(const sys::Path& path,
std::set<sys::Path>& result, std::string* ErrMsg) {
result.clear();
if (RecurseDirectories) {
// putMode - utility function for printing out the file mode when the 't'
// operation is in verbose mode.
-void
+void
printMode(unsigned mode) {
if (mode & 004)
outs() << "r";
// the file names of each of the members. However, if verbose mode is requested
// ('v' modifier) then the file type, permission mode, user, group, size, and
// modification time are also printed.
-bool
+bool
doDisplayTable(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg))
return true;
// doExtract - Implement the 'x' operation. This function extracts files back to
// the file system, making sure to uncompress any that were compressed
-bool
+bool
doExtract(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg))
return true;
if (I->hasPath()) {
sys::Path dirs(I->getPath());
dirs.eraseComponent();
- if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
+ if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
return true;
}
// members from the archive. Note that if the count is specified, there should
// be no more than one path in the Paths list or else this algorithm breaks.
// That check is enforced in parseCommandLine (above).
-bool
+bool
doDelete(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg))
return true;
- if (Paths.empty())
+ if (Paths.empty())
return false;
unsigned countDown = Count;
for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
// order of the archive members so that when the archive is written the move
// of the members is accomplished. Note the use of the RelPos variable to
// determine where the items should be moved to.
-bool
+bool
doMove(std::string* ErrMsg) {
- if (buildPaths(false, ErrMsg))
+ if (buildPaths(false, ErrMsg))
return true;
// By default and convention the place to move members to is the end of the
// doQuickAppend - Implements the 'q' operation. This function just
// indiscriminantly adds the members to the archive and rebuilds it.
-bool
+bool
doQuickAppend(std::string* ErrMsg) {
// Get the list of paths to append.
if (buildPaths(true, ErrMsg))
return true;
- if (Paths.empty())
+ if (Paths.empty())
return false;
// Append them quickly.
// doReplaceOrInsert - Implements the 'r' operation. This function will replace
// any existing files or insert new ones into the archive.
-bool
+bool
doReplaceOrInsert(std::string* ErrMsg) {
// Build the list of files to be added/replaced.
if (buildPaths(true, ErrMsg))
return true;
- if (Paths.empty())
+ if (Paths.empty())
return false;
// Keep track of the paths that remain to be inserted.
if (found != remaining.end()) {
std::string Err;
- sys::PathWithStatus PwS(*found);
+ sys::PathWithStatus PwS(*found);
const sys::FileStatus *si = PwS.getFileStatus(false, &Err);
if (!si)
return true;