summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2008-02-28 22:24:48 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2008-02-28 22:24:48 +0000
commit09b64a4ed1d02585a29571f91fe792ab11c5d14a (patch)
treea2e3c53b000a9663c74f5749b07bb2b5a0c92cf1 /llvm/lib
parent714eeb2d55703a5bf124efc6a7221f8c9a7814de (diff)
downloadbcm5719-llvm-09b64a4ed1d02585a29571f91fe792ab11c5d14a.tar.gz
bcm5719-llvm-09b64a4ed1d02585a29571f91fe792ab11c5d14a.zip
Make llvm-ar behave like ar, if you create an empty archive, ar creates an empty archive. llvm-ar would not generate an output file in this case
llvm-svn: 47733
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Archive/ArchiveWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Archive/ArchiveWriter.cpp b/llvm/lib/Archive/ArchiveWriter.cpp
index 07f7d88dd82..04cc981f796 100644
--- a/llvm/lib/Archive/ArchiveWriter.cpp
+++ b/llvm/lib/Archive/ArchiveWriter.cpp
@@ -348,7 +348,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
{
// Make sure they haven't opened up the file, not loaded it,
// but are now trying to write it which would wipe out the file.
- if (members.empty() && mapfile->size() > 8) {
+ if (members.empty() && mapfile && mapfile->size() > 8) {
if (ErrMsg)
*ErrMsg = "Can't write an archive not opened for writing";
return true;
OpenPOWER on IntegriCloud