Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2011-01-10 02:34:40 +00:00
parent 54453f2978
commit 83a113b77c
3 changed files with 31 additions and 31 deletions

View File

@ -166,19 +166,19 @@ void Archive::cleanUpMemory() {
delete mapfile; delete mapfile;
mapfile = 0; mapfile = 0;
base = 0; base = 0;
// Forget the entire symbol table // Forget the entire symbol table
symTab.clear(); symTab.clear();
symTabSize = 0; symTabSize = 0;
firstFileOffset = 0; firstFileOffset = 0;
// Free the foreign symbol table member // Free the foreign symbol table member
if (foreignST) { if (foreignST) {
delete foreignST; delete foreignST;
foreignST = 0; foreignST = 0;
} }
// Delete any Modules and ArchiveMember's we've allocated as a result of // Delete any Modules and ArchiveMember's we've allocated as a result of
// symbol table searches. // symbol table searches.
for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) { for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) {
@ -200,7 +200,7 @@ static void getSymbols(Module*M, std::vector<std::string>& symbols) {
if (!GI->isDeclaration() && !GI->hasLocalLinkage()) if (!GI->isDeclaration() && !GI->hasLocalLinkage())
if (!GI->getName().empty()) if (!GI->getName().empty())
symbols.push_back(GI->getName()); symbols.push_back(GI->getName());
// Loop over functions // Loop over functions
for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI) for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
if (!FI->isDeclaration() && !FI->hasLocalLinkage()) if (!FI->isDeclaration() && !FI->hasLocalLinkage())
@ -226,14 +226,14 @@ bool llvm::GetBitcodeSymbols(const sys::Path& fName,
+ ec.message(); + ec.message();
return true; return true;
} }
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg); Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M) if (!M)
return true; return true;
// Get the symbols // Get the symbols
getSymbols(M, symbols); getSymbols(M, symbols);
// Done with the module. // Done with the module.
delete M; delete M;
return true; return true;
@ -248,14 +248,14 @@ llvm::GetBitcodeSymbols(const char *BufPtr, unsigned Length,
// Get the module. // Get the module.
OwningPtr<MemoryBuffer> Buffer( OwningPtr<MemoryBuffer> Buffer(
MemoryBuffer::getMemBufferCopy(StringRef(BufPtr, Length),ModuleID.c_str())); MemoryBuffer::getMemBufferCopy(StringRef(BufPtr, Length),ModuleID.c_str()));
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg); Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M) if (!M)
return 0; return 0;
// Get the symbols // Get the symbols
getSymbols(M, symbols); getSymbols(M, symbols);
// Done with the module. Note that it's the caller's responsibility to delete // Done with the module. Note that it's the caller's responsibility to delete
// the Module. // the Module.
return M; return M;

View File

@ -155,7 +155,7 @@ Archive::fillHeader(const ArchiveMember &mbr, ArchiveMemberHeader& hdr,
// Insert a file into the archive before some other member. This also takes care // Insert a file into the archive before some other member. This also takes care
// of extracting the necessary flags and information from the file. // of extracting the necessary flags and information from the file.
bool bool
Archive::addFileBefore(const sys::Path& filePath, iterator where, Archive::addFileBefore(const sys::Path& filePath, iterator where,
std::string* ErrMsg) { std::string* ErrMsg) {
bool Exists; bool Exists;
if (sys::fs::exists(filePath.str(), Exists) || !Exists) { if (sys::fs::exists(filePath.str(), Exists) || !Exists) {
@ -232,7 +232,7 @@ Archive::writeMember(
std::vector<std::string> symbols; std::vector<std::string> symbols;
std::string FullMemberName = archPath.str() + "(" + member.getPath().str() std::string FullMemberName = archPath.str() + "(" + member.getPath().str()
+ ")"; + ")";
Module* M = Module* M =
GetBitcodeSymbols(data, fSize, FullMemberName, Context, symbols, ErrMsg); GetBitcodeSymbols(data, fSize, FullMemberName, Context, symbols, ErrMsg);
// If the bitcode parsed successfully // If the bitcode parsed successfully
@ -421,7 +421,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
} }
const char* base = arch->getBufferStart(); 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 // mmapped data
if (FinalFilePath.createTemporaryFileOnDisk(ErrMsg)) if (FinalFilePath.createTemporaryFileOnDisk(ErrMsg))
return true; return true;
@ -462,17 +462,17 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Close up shop // Close up shop
FinalFile.close(); FinalFile.close();
} // free arch. } // free arch.
// Move the final file over top of TmpArchive // Move the final file over top of TmpArchive
if (FinalFilePath.renamePathOnDisk(TmpArchive, ErrMsg)) if (FinalFilePath.renamePathOnDisk(TmpArchive, ErrMsg))
return true; return true;
} }
// Before we replace the actual archive, we need to forget all the // 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 // members, since they point to data in that old archive. We need to do
// this because we cannot replace an open file on Windows. // this because we cannot replace an open file on Windows.
cleanUpMemory(); cleanUpMemory();
if (TmpArchive.renamePathOnDisk(archPath, ErrMsg)) if (TmpArchive.renamePathOnDisk(archPath, ErrMsg))
return true; return true;

View File

@ -274,7 +274,7 @@ ArchiveOperation parseCommandLine() {
// finds with all the files in that directory (recursively). It uses the // finds with all the files in that directory (recursively). It uses the
// sys::Path::getDirectoryContent method to perform the actual directory scans. // sys::Path::getDirectoryContent method to perform the actual directory scans.
bool bool
recurseDirectories(const sys::Path& path, recurseDirectories(const sys::Path& path,
std::set<sys::Path>& result, std::string* ErrMsg) { std::set<sys::Path>& result, std::string* ErrMsg) {
result.clear(); result.clear();
if (RecurseDirectories) { if (RecurseDirectories) {
@ -380,7 +380,7 @@ bool doPrint(std::string* ErrMsg) {
// putMode - utility function for printing out the file mode when the 't' // putMode - utility function for printing out the file mode when the 't'
// operation is in verbose mode. // operation is in verbose mode.
void void
printMode(unsigned mode) { printMode(unsigned mode) {
if (mode & 004) if (mode & 004)
outs() << "r"; outs() << "r";
@ -400,7 +400,7 @@ printMode(unsigned mode) {
// the file names of each of the members. However, if verbose mode is requested // 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 // ('v' modifier) then the file type, permission mode, user, group, size, and
// modification time are also printed. // modification time are also printed.
bool bool
doDisplayTable(std::string* ErrMsg) { doDisplayTable(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg)) if (buildPaths(false, ErrMsg))
return true; return true;
@ -438,7 +438,7 @@ doDisplayTable(std::string* ErrMsg) {
// doExtract - Implement the 'x' operation. This function extracts files back to // doExtract - Implement the 'x' operation. This function extracts files back to
// the file system, making sure to uncompress any that were compressed // the file system, making sure to uncompress any that were compressed
bool bool
doExtract(std::string* ErrMsg) { doExtract(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg)) if (buildPaths(false, ErrMsg))
return true; return true;
@ -451,7 +451,7 @@ doExtract(std::string* ErrMsg) {
if (I->hasPath()) { if (I->hasPath()) {
sys::Path dirs(I->getPath()); sys::Path dirs(I->getPath());
dirs.eraseComponent(); dirs.eraseComponent();
if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
return true; return true;
} }
@ -481,11 +481,11 @@ doExtract(std::string* ErrMsg) {
// members from the archive. Note that if the count is specified, there should // 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. // be no more than one path in the Paths list or else this algorithm breaks.
// That check is enforced in parseCommandLine (above). // That check is enforced in parseCommandLine (above).
bool bool
doDelete(std::string* ErrMsg) { doDelete(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg)) if (buildPaths(false, ErrMsg))
return true; return true;
if (Paths.empty()) if (Paths.empty())
return false; return false;
unsigned countDown = Count; unsigned countDown = Count;
for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end();
@ -514,9 +514,9 @@ doDelete(std::string* ErrMsg) {
// order of the archive members so that when the archive is written the move // 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 // of the members is accomplished. Note the use of the RelPos variable to
// determine where the items should be moved to. // determine where the items should be moved to.
bool bool
doMove(std::string* ErrMsg) { doMove(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg)) if (buildPaths(false, ErrMsg))
return true; return true;
// By default and convention the place to move members to is the end of the // By default and convention the place to move members to is the end of the
@ -567,12 +567,12 @@ doMove(std::string* ErrMsg) {
// doQuickAppend - Implements the 'q' operation. This function just // doQuickAppend - Implements the 'q' operation. This function just
// indiscriminantly adds the members to the archive and rebuilds it. // indiscriminantly adds the members to the archive and rebuilds it.
bool bool
doQuickAppend(std::string* ErrMsg) { doQuickAppend(std::string* ErrMsg) {
// Get the list of paths to append. // Get the list of paths to append.
if (buildPaths(true, ErrMsg)) if (buildPaths(true, ErrMsg))
return true; return true;
if (Paths.empty()) if (Paths.empty())
return false; return false;
// Append them quickly. // Append them quickly.
@ -592,13 +592,13 @@ doQuickAppend(std::string* ErrMsg) {
// doReplaceOrInsert - Implements the 'r' operation. This function will replace // doReplaceOrInsert - Implements the 'r' operation. This function will replace
// any existing files or insert new ones into the archive. // any existing files or insert new ones into the archive.
bool bool
doReplaceOrInsert(std::string* ErrMsg) { doReplaceOrInsert(std::string* ErrMsg) {
// Build the list of files to be added/replaced. // Build the list of files to be added/replaced.
if (buildPaths(true, ErrMsg)) if (buildPaths(true, ErrMsg))
return true; return true;
if (Paths.empty()) if (Paths.empty())
return false; return false;
// Keep track of the paths that remain to be inserted. // Keep track of the paths that remain to be inserted.
@ -638,7 +638,7 @@ doReplaceOrInsert(std::string* ErrMsg) {
if (found != remaining.end()) { if (found != remaining.end()) {
std::string Err; std::string Err;
sys::PathWithStatus PwS(*found); sys::PathWithStatus PwS(*found);
const sys::FileStatus *si = PwS.getFileStatus(false, &Err); const sys::FileStatus *si = PwS.getFileStatus(false, &Err);
if (!si) if (!si)
return true; return true;