summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/llvm-ar.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 18:55:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 18:55:44 +0000
commit8a3a90bdc43bee68ec60225ffc310f469fca7072 (patch)
tree5a37b9c7cb0f7dea30b8d41d73495ea91952aa57 /llvm/tools/llvm-ar/llvm-ar.cpp
parent97b5f2fafcc738da92192dbb42f917da7c5d29c7 (diff)
downloadbcm5719-llvm-8a3a90bdc43bee68ec60225ffc310f469fca7072.tar.gz
bcm5719-llvm-8a3a90bdc43bee68ec60225ffc310f469fca7072.zip
Remove a trivial use of sys::Path.
llvm-svn: 184455
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index e422f310c6b..53b2d02c3fd 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -653,26 +653,19 @@ int main(int argc, char **argv) {
// can't handle the grouped positional parameters without a dash.
ArchiveOperation Operation = parseCommandLine();
- // Check the path name of the archive
- sys::Path ArchivePath;
- if (!ArchivePath.set(ArchiveName)) {
- errs() << argv[0] << ": Archive name invalid: " << ArchiveName << "\n";
- return 1;
- }
-
// Create or open the archive object.
bool Exists;
- if (llvm::sys::fs::exists(ArchivePath.str(), Exists) || !Exists) {
+ if (llvm::sys::fs::exists(ArchiveName, Exists) || !Exists) {
// Produce a warning if we should and we're creating the archive
if (!Create)
- errs() << argv[0] << ": creating " << ArchivePath.str() << "\n";
- TheArchive = Archive::CreateEmpty(ArchivePath.str(), Context);
+ errs() << argv[0] << ": creating " << ArchiveName << "\n";
+ TheArchive = Archive::CreateEmpty(ArchiveName, Context);
TheArchive->writeToDisk();
} else {
std::string Error;
- TheArchive = Archive::OpenAndLoad(ArchivePath.str(), Context, &Error);
+ TheArchive = Archive::OpenAndLoad(ArchiveName, Context, &Error);
if (TheArchive == 0) {
- errs() << argv[0] << ": error loading '" << ArchivePath.str() << "': "
+ errs() << argv[0] << ": error loading '" << ArchiveName << "': "
<< Error << "!\n";
return 1;
}
OpenPOWER on IntegriCloud