summaryrefslogtreecommitdiff
path: root/tools
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
commit201c66c9b06e509d0a02972e7947a8e97aa17a2e (patch)
treed6749288ed36cb8679e1e2cd0fad6b29a6bd1c4b /tools
parent51d1bda39b8f8145ef0e9aa98fdfc1752cce95ec (diff)
downloadllvm-201c66c9b06e509d0a02972e7947a8e97aa17a2e.tar.gz
llvm-201c66c9b06e509d0a02972e7947a8e97aa17a2e.tar.bz2
llvm-201c66c9b06e509d0a02972e7947a8e97aa17a2e.tar.xz
Remove a trivial use of sys::Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index e422f310c6..53b2d02c3f 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/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;
}