Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Object/TapiFile.cpp
Show All 34 Lines | static uint32_t getFlags(const Symbol *Sym) { | ||||
if (Sym->isWeakDefined() || Sym->isWeakReferenced()) | if (Sym->isWeakDefined() || Sym->isWeakReferenced()) | ||||
Flags |= BasicSymbolRef::SF_Weak; | Flags |= BasicSymbolRef::SF_Weak; | ||||
return Flags; | return Flags; | ||||
} | } | ||||
TapiFile::TapiFile(MemoryBufferRef Source, const InterfaceFile &interface, | TapiFile::TapiFile(MemoryBufferRef Source, const InterfaceFile &interface, | ||||
Architecture Arch) | Architecture Arch) | ||||
: SymbolicFile(ID_TapiFile, Source) { | : SymbolicFile(ID_TapiFile, Source), Arch(Arch) { | ||||
for (const auto *Symbol : interface.symbols()) { | for (const auto *Symbol : interface.symbols()) { | ||||
JDevlieghere: Why not do this in the initializer list? | |||||
if (!Symbol->getArchitectures().has(Arch)) | if (!Symbol->getArchitectures().has(Arch)) | ||||
continue; | continue; | ||||
switch (Symbol->getKind()) { | switch (Symbol->getKind()) { | ||||
case SymbolKind::GlobalSymbol: | case SymbolKind::GlobalSymbol: | ||||
Symbols.emplace_back(StringRef(), Symbol->getName(), getFlags(Symbol)); | Symbols.emplace_back(StringRef(), Symbol->getName(), getFlags(Symbol)); | ||||
break; | break; | ||||
case SymbolKind::ObjectiveCClass: | case SymbolKind::ObjectiveCClass: | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Why not do this in the initializer list?