• Home
  • Raw
  • Download

Lines Matching +full:llvm +full:- +full:ranlib

1 //===-- llvm-ar.cpp - LLVM archive librarian utility ----------------------===//
3 // The LLVM Compiler Infrastructure
8 //===----------------------------------------------------------------------===//
10 // Builds up (relatively) standard unix archive files (.a) containing LLVM
13 //===----------------------------------------------------------------------===//
15 #include "llvm/ADT/StringSwitch.h"
16 #include "llvm/ADT/Triple.h"
17 #include "llvm/IR/LLVMContext.h"
18 #include "llvm/IR/Module.h"
19 #include "llvm/LibDriver/LibDriver.h"
20 #include "llvm/Object/Archive.h"
21 #include "llvm/Object/ArchiveWriter.h"
22 #include "llvm/Object/MachO.h"
23 #include "llvm/Object/ObjectFile.h"
24 #include "llvm/Support/CommandLine.h"
25 #include "llvm/Support/Errc.h"
26 #include "llvm/Support/FileSystem.h"
27 #include "llvm/Support/Format.h"
28 #include "llvm/Support/LineIterator.h"
29 #include "llvm/Support/ManagedStatic.h"
30 #include "llvm/Support/MemoryBuffer.h"
31 #include "llvm/Support/Path.h"
32 #include "llvm/Support/PrettyStackTrace.h"
33 #include "llvm/Support/Signals.h"
34 #include "llvm/Support/TargetSelect.h"
35 #include "llvm/Support/ToolOutputFile.h"
36 #include "llvm/Support/raw_ostream.h"
47 using namespace llvm;
72 handleAllErrors(std::move(E), [&](const llvm::ErrorInfoBase &EIB) { in failIfError()
80 // llvm-ar/llvm-ranlib remaining positional arguments.
83 cl::desc("[relpos] [count] <archive-file> [members]..."));
101 // llvm-ar. This object instructs the CommandLine library to print the text of
102 // the constructor when the --help option is given.
105 " d[NsS] - delete file(s) from the archive\n"
106 " m[abiSs] - move file(s) in the archive\n"
107 " p[kN] - print file(s) found in the archive\n"
108 " q[ufsS] - quick append file(s) to the archive\n"
109 " r[abfiuRsS] - replace or insert file(s) into the archive\n"
110 " t - display contents of archive\n"
111 " x[No] - extract file(s) from the archive\n"
113 " [a] - put file(s) after [relpos]\n"
114 " [b] - put file(s) before [relpos] (same as [i])\n"
115 " [i] - put file(s) before [relpos] (same as [b])\n"
116 " [o] - preserve original dates\n"
117 " [s] - create an archive index (cf. ranlib)\n"
118 " [S] - do not build a symbol table\n"
119 " [u] - update only files newer than archive contents\n"
121 " [c] - do not warn if the library had to be created\n"
122 " [v] - be verbose about actions taken\n"
209 fail("Cannot mix -M and other options"); in parseCommandLine()
329 outs() << ((mode & 004) ? "r" : "-"); in printMode()
330 outs() << ((mode & 002) ? "w" : "-"); in printMode()
331 outs() << ((mode & 001) ? "x" : "-"); in printMode()
404 if (Operation == Extract && OldArchive->isThin()) in performReadOperation()
410 for (auto &C : OldArchive->children(Err)) { in performReadOperation()
447 StringRef FileName, int Pos = -1) { in addMember()
451 if (Pos == -1) in addMember()
458 const object::Archive::Child &M, int Pos = -1) { in addMember()
459 if (Thin && !M.getParent()->isThin()) in addMember()
464 if (Pos == -1) in addMember()
533 int InsertPos = -1; in computeNewArchiveMembers()
537 for (auto &Child : OldArchive->children(Err)) { in computeNewArchiveMembers()
578 if (!RelPos.empty() && InsertPos == -1) in computeNewArchiveMembers()
609 object::ObjectFile::createObjectFile(Member.Buf->getMemBufferRef()); in getKindFromMember()
616 // squelch the error in case we had a non-object file in getKindFromMember()
636 Kind = OldArchive->kind(); in performWriteOperation()
638 Kind = NewMembersP->size() ? getKindFromMember(NewMembersP->front()) in performWriteOperation()
666 // they have to run ranlib. in createSymbolTable()
667 if (OldArchive->hasSymbolTable()) in createSymbolTable()
702 MemoryBuffer::getFile(ArchiveName, -1, false); in performOperation()
709 object::Archive Archive(Buf.get()->getMemBufferRef(), Err); in performOperation()
760 auto BufOrErr = MemoryBuffer::getFile(Rest, -1, false); in runMRIScript()
764 object::Archive::create(ArchiveBuffers.back()->getMemBufferRef()); in runMRIScript()
825 llvm::InitializeAllTargetInfos(); in main()
826 llvm::InitializeAllTargetMCs(); in main()
827 llvm::InitializeAllAsmParsers(); in main()
830 if (Stem.find("ranlib") == StringRef::npos && in main()
835 // like --help and --version. in main()
837 "LLVM Archiver (llvm-ar)\n\n" in main()
841 if (Stem.find("ranlib") != StringRef::npos) in main()
845 fail("Not ranlib, ar or lib!"); in main()