[lld-macho] Remove unnecessary llvm:: namespace prefixes

This commit is contained in:
Jez Ng 2021-01-09 11:58:19 -05:00
parent 6a6e382161
commit e98b441a09
5 changed files with 15 additions and 15 deletions

View File

@ -75,7 +75,7 @@ static HeaderFileType getOutputType(const opt::InputArgList &args) {
static Optional<std::string>
findAlongPathsWithExtensions(StringRef name, ArrayRef<StringRef> extensions) {
llvm::SmallString<261> base;
SmallString<261> base;
for (StringRef dir : config->librarySearchPaths) {
base = dir;
path::append(base, Twine("lib") + name);
@ -99,7 +99,7 @@ static Optional<std::string> findLibrary(StringRef name) {
}
static Optional<std::string> findFramework(StringRef name) {
llvm::SmallString<260> symlink;
SmallString<260> symlink;
StringRef suffix;
std::tie(name, suffix) = name.split(",");
for (StringRef dir : config->frameworkSearchPaths) {
@ -109,7 +109,7 @@ static Optional<std::string> findFramework(StringRef name) {
if (!suffix.empty()) {
// NOTE: we must resolve the symlink before trying the suffixes, because
// there are no symlinks for the suffixed paths.
llvm::SmallString<260> location;
SmallString<260> location;
if (!fs::real_path(symlink, location)) {
// only append suffix if realpath() succeeds
Twine suffixed = location + suffix;
@ -127,11 +127,11 @@ static Optional<std::string> findFramework(StringRef name) {
static TargetInfo *createTargetInfo(opt::InputArgList &args) {
StringRef arch = args.getLastArgValue(OPT_arch, "x86_64");
config->arch = llvm::MachO::getArchitectureFromName(
config->arch = MachO::getArchitectureFromName(
args.getLastArgValue(OPT_arch, arch));
switch (config->arch) {
case llvm::MachO::AK_x86_64:
case llvm::MachO::AK_x86_64h:
case MachO::AK_x86_64:
case MachO::AK_x86_64h:
return createX86_64TargetInfo();
default:
fatal("missing or unsupported -arch " + arch);
@ -575,7 +575,7 @@ static void handlePlatformVersion(const opt::Arg *arg) {
static void handleUndefined(const opt::Arg *arg) {
StringRef treatmentStr = arg->getValue(0);
config->undefinedSymbolTreatment =
llvm::StringSwitch<UndefinedSymbolTreatment>(treatmentStr)
StringSwitch<UndefinedSymbolTreatment>(treatmentStr)
.Case("error", UndefinedSymbolTreatment::error)
.Case("warning", UndefinedSymbolTreatment::warning)
.Case("suppress", UndefinedSymbolTreatment::suppress)
@ -677,7 +677,7 @@ static uint32_t parseDylibVersion(const opt::ArgList& args, unsigned id) {
return version.rawValue();
}
bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly,
bool macho::link(ArrayRef<const char *> argsArr, bool canExitEarly,
raw_ostream &stdoutOS, raw_ostream &stderrOS) {
lld::stdoutOS = &stdoutOS;
lld::stderrOS = &stderrOS;
@ -762,11 +762,11 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly,
message(getLLDVersion());
message(StringRef("Library search paths:") +
(config->librarySearchPaths.size()
? "\n\t" + llvm::join(config->librarySearchPaths, "\n\t")
? "\n\t" + join(config->librarySearchPaths, "\n\t")
: ""));
message(StringRef("Framework search paths:") +
(config->frameworkSearchPaths.size()
? "\n\t" + llvm::join(config->frameworkSearchPaths, "\n\t")
? "\n\t" + join(config->frameworkSearchPaths, "\n\t")
: ""));
freeArena();
return !errorCount();

View File

@ -664,7 +664,7 @@ DylibFile::DylibFile(const InterfaceFile &interface, DylibFile *umbrella)
currentTopLevelTapi = nullptr;
}
ArchiveFile::ArchiveFile(std::unique_ptr<llvm::object::Archive> &&f)
ArchiveFile::ArchiveFile(std::unique_ptr<object::Archive> &&f)
: InputFile(ArchiveKind, f->getMemoryBufferRef()), file(std::move(f)) {
for (const object::Archive::Symbol &sym : file->symbols())
symtab->addLazy(sym.getName(), this, sym);

View File

@ -35,7 +35,7 @@ static lto::Config createConfig() {
BitcodeCompiler::BitcodeCompiler() {
auto backend =
lto::createInProcessThinBackend(llvm::heavyweight_hardware_concurrency());
lto::createInProcessThinBackend(heavyweight_hardware_concurrency());
ltoObj = std::make_unique<lto::LTO>(createConfig(), backend);
}

View File

@ -49,7 +49,7 @@ void OutputSegment::addOutputSection(OutputSection *osec) {
sections.push_back(osec);
}
static llvm::DenseMap<StringRef, OutputSegment *> nameToOutputSegment;
static DenseMap<StringRef, OutputSegment *> nameToOutputSegment;
std::vector<OutputSegment *> macho::outputSegments;
OutputSegment *macho::getOrCreateOutputSegment(StringRef name) {

View File

@ -18,7 +18,7 @@ using namespace lld;
using namespace lld::macho;
Symbol *SymbolTable::find(StringRef name) {
auto it = symMap.find(llvm::CachedHashStringRef(name));
auto it = symMap.find(CachedHashStringRef(name));
if (it == symMap.end())
return nullptr;
return symVector[it->second];
@ -135,7 +135,7 @@ Symbol *SymbolTable::addDylib(StringRef name, DylibFile *file, bool isWeakDef,
}
Symbol *SymbolTable::addLazy(StringRef name, ArchiveFile *file,
const llvm::object::Archive::Symbol &sym) {
const object::Archive::Symbol &sym) {
Symbol *s;
bool wasInserted;
std::tie(s, wasInserted) = insert(name);