// If we are updating, we might get dSYM bundles as input.
std::vector<std::string> Inputs;
for (const auto &Input : InputFiles) {
- if (!llvm::sys::fs::is_directory(Input)) {
+ if (!sys::fs::is_directory(Input)) {
Inputs.push_back(Input);
continue;
}
// Make sure that we're dealing with a dSYM bundle.
SmallString<256> BundlePath(Input);
sys::path::append(BundlePath, "Contents", "Resources", "DWARF");
- if (!llvm::sys::fs::is_directory(BundlePath))
+ if (!sys::fs::is_directory(BundlePath))
return make_error<StringError>(
Input + " is a directory, but doesn't look like a dSYM bundle.",
inconvertibleErrorCode());
// Create a directory iterator to iterate over all the entries in the
// bundle.
std::error_code EC;
- llvm::sys::fs::directory_iterator DirIt(BundlePath, EC);
- llvm::sys::fs::directory_iterator DirEnd;
+ sys::fs::directory_iterator DirIt(BundlePath, EC);
+ sys::fs::directory_iterator DirEnd;
if (EC)
return errorCodeToError(EC);
}
// Verify that the given combination of options makes sense.
-static llvm::Error verifyOptions(const DsymutilOptions &Options) {
+static Error verifyOptions(const DsymutilOptions &Options) {
if (Options.LinkOptions.Update &&
std::find(Options.InputFiles.begin(), Options.InputFiles.end(), "-") !=
Options.InputFiles.end()) {
if (opt::Arg *NumThreads = Args.getLastArg(OPT_threads))
Options.LinkOptions.Threads = atoi(NumThreads->getValue());
else
- Options.LinkOptions.Threads = llvm::thread::hardware_concurrency();
+ Options.LinkOptions.Threads = thread::hardware_concurrency();
if (Options.DumpDebugMap || Options.LinkOptions.Verbose)
Options.LinkOptions.Threads = 1;
return Options;
}
-static Error createPlistFile(llvm::StringRef Bin, llvm::StringRef BundleRoot,
- llvm::StringRef Toolchain) {
+static Error createPlistFile(StringRef Bin, StringRef BundleRoot,
+ StringRef Toolchain) {
// Create plist file to write to.
- llvm::SmallString<128> InfoPlist(BundleRoot);
- llvm::sys::path::append(InfoPlist, "Contents/Info.plist");
+ SmallString<128> InfoPlist(BundleRoot);
+ sys::path::append(InfoPlist, "Contents/Info.plist");
std::error_code EC;
- llvm::raw_fd_ostream PL(InfoPlist, EC, llvm::sys::fs::OF_Text);
+ raw_fd_ostream PL(InfoPlist, EC, sys::fs::OF_Text);
if (EC)
return make_error<StringError>(
"cannot create Plist: " + toString(errorCodeToError(EC)), EC);
CFBundleInfo BI = getBundleInfo(Bin);
if (BI.IDStr.empty()) {
- llvm::StringRef BundleID = *llvm::sys::path::rbegin(BundleRoot);
- if (llvm::sys::path::extension(BundleRoot) == ".dSYM")
- BI.IDStr = llvm::sys::path::stem(BundleID);
+ StringRef BundleID = *sys::path::rbegin(BundleRoot);
+ if (sys::path::extension(BundleRoot) == ".dSYM")
+ BI.IDStr = sys::path::stem(BundleID);
else
BI.IDStr = BundleID;
}
return Error::success();
}
-static Error createBundleDir(llvm::StringRef BundleBase) {
- llvm::SmallString<128> Bundle(BundleBase);
- llvm::sys::path::append(Bundle, "Contents", "Resources", "DWARF");
+static Error createBundleDir(StringRef BundleBase) {
+ SmallString<128> Bundle(BundleBase);
+ sys::path::append(Bundle, "Contents", "Resources", "DWARF");
if (std::error_code EC =
- create_directories(Bundle.str(), true, llvm::sys::fs::perms::all_all))
+ create_directories(Bundle.str(), true, sys::fs::perms::all_all))
return make_error<StringError>(
"cannot create bundle: " + toString(errorCodeToError(EC)), EC);
return Error::success();
}
-static bool verify(llvm::StringRef OutputFile, llvm::StringRef Arch,
- bool Verbose) {
+static bool verify(StringRef OutputFile, StringRef Arch, bool Verbose) {
if (OutputFile == "-") {
WithColor::warning() << "verification skipped for " << Arch
<< "because writing to stdout.\n";
namespace {
struct OutputLocation {
- OutputLocation(std::string DWARFFile,
- llvm::Optional<std::string> ResourceDir = {})
+ OutputLocation(std::string DWARFFile, Optional<std::string> ResourceDir = {})
: DWARFFile(DWARFFile), ResourceDir(ResourceDir) {}
/// This method is a workaround for older compilers.
- llvm::Optional<std::string> getResourceDir() const { return ResourceDir; }
+ Optional<std::string> getResourceDir() const { return ResourceDir; }
std::string DWARFFile;
- llvm::Optional<std::string> ResourceDir;
+ Optional<std::string> ResourceDir;
};
} // namespace
static Expected<OutputLocation>
-getOutputFileName(llvm::StringRef InputFile, const DsymutilOptions &Options) {
+getOutputFileName(StringRef InputFile, const DsymutilOptions &Options) {
if (Options.OutputFile == "-")
return OutputLocation(Options.OutputFile);
// Resources/
// DWARF/
// <DWARF file(s)>
- std::string DwarfFile =
- InputFile == "-" ? llvm::StringRef("a.out") : InputFile;
- llvm::SmallString<128> Path(Options.OutputFile);
+ std::string DwarfFile = InputFile == "-" ? StringRef("a.out") : InputFile;
+ SmallString<128> Path(Options.OutputFile);
if (Path.empty())
Path = DwarfFile + ".dSYM";
if (!Options.LinkOptions.NoOutput) {
return std::move(E);
}
- llvm::sys::path::append(Path, "Contents", "Resources");
+ sys::path::append(Path, "Contents", "Resources");
std::string ResourceDir = Path.str();
- llvm::sys::path::append(Path, "DWARF", llvm::sys::path::filename(DwarfFile));
+ sys::path::append(Path, "DWARF", sys::path::filename(DwarfFile));
return OutputLocation(Path.str(), ResourceDir);
}
opt::InputArgList Args = T.ParseArgs(ArgsArr, MAI, MAC);
void *P = (void *)(intptr_t)getOutputFileName;
- std::string SDKPath = llvm::sys::fs::getMainExecutable(argv[0], P);
- SDKPath = llvm::sys::path::parent_path(SDKPath);
+ std::string SDKPath = sys::fs::getMainExecutable(argv[0], P);
+ SDKPath = sys::path::parent_path(SDKPath);
if (Args.hasArg(OPT_help)) {
T.PrintHelp(
- llvm::outs(),
- (std::string(argv[0]) + " [options] <input files>").c_str(),
+ outs(), (std::string(argv[0]) + " [options] <input files>").c_str(),
"manipulate archived DWARF debug symbol files.\n\n"
"dsymutil links the DWARF debug information found in the object files\n"
"for the executable <input file> by using debug symbols information\n"
}
if (Args.hasArg(OPT_version)) {
- llvm::cl::PrintVersionMessage();
+ cl::PrintVersionMessage();
return 0;
}
auto &Options = *OptionsOrErr;
- llvm::InitializeAllTargetInfos();
- llvm::InitializeAllTargetMCs();
- llvm::InitializeAllTargets();
- llvm::InitializeAllAsmPrinters();
+ InitializeAllTargetInfos();
+ InitializeAllTargetMCs();
+ InitializeAllTargets();
+ InitializeAllAsmPrinters();
for (const auto &Arch : Options.Archs)
if (Arch != "*" && Arch != "all" &&
- !llvm::object::MachOObjectFile::isValidArch(Arch)) {
+ !object::MachOObjectFile::isValidArch(Arch)) {
WithColor::error() << "unsupported cpu architecture: '" << Arch << "'\n";
return 1;
}
// the input file.
for (auto &Map : *DebugMapPtrsOrErr)
Map->addDebugMapObject(InputFile,
- llvm::sys::TimePoint<std::chrono::seconds>());
+ sys::TimePoint<std::chrono::seconds>());
}
// Ensure that the debug map is not empty (anymore).
unsigned ThreadCount = std::min<unsigned>(Options.LinkOptions.Threads,
DebugMapPtrsOrErr->size());
- llvm::ThreadPool Threads(ThreadCount);
+ ThreadPool Threads(ThreadCount);
// If there is more than one link to execute, we need to generate
// temporary files.
!Options.DumpDebugMap && (Options.OutputFile != "-") &&
(DebugMapPtrsOrErr->size() != 1 || Options.LinkOptions.Update);
- llvm::SmallVector<MachOUtils::ArchAndFile, 4> TempFiles;
+ SmallVector<MachOUtils::ArchAndFile, 4> TempFiles;
std::atomic_char AllOK(1);
for (auto &Map : *DebugMapPtrsOrErr) {
if (Options.LinkOptions.Verbose || Options.DumpDebugMap)
- Map->print(llvm::outs());
+ Map->print(outs());
if (Options.DumpDebugMap)
continue;