[lld] r262813 - Split BitcodeFile::parse. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 6 16:54:17 PST 2016
Author: ruiu
Date: Sun Mar 6 18:54:17 2016
New Revision: 262813
URL: http://llvm.org/viewvc/llvm-project?rev=262813&view=rev
Log:
Split BitcodeFile::parse. NFC.
Modified:
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=262813&r1=262812&r2=262813&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Sun Mar 6 18:54:17 2016
@@ -414,6 +414,17 @@ bool BitcodeFile::classof(const InputFil
return F->kind() == BitcodeKind;
}
+static uint8_t getGvVisibility(const GlobalValue *GV) {
+ switch (GV->getVisibility()) {
+ case GlobalValue::HiddenVisibility:
+ return STV_HIDDEN;
+ case GlobalValue::ProtectedVisibility:
+ return STV_PROTECTED;
+ default:
+ return STV_DEFAULT;
+ }
+}
+
void BitcodeFile::parse(DenseSet<StringRef> &ComdatGroups) {
LLVMContext Context;
std::unique_ptr<IRObjectFile> Obj = check(IRObjectFile::create(MB, Context));
@@ -432,23 +443,14 @@ void BitcodeFile::parse(DenseSet<StringR
if (const Comdat *C = GV->getComdat())
if (!KeptComdats.count(C))
continue;
- switch (GV->getVisibility()) {
- case GlobalValue::DefaultVisibility:
- Visibility = STV_DEFAULT;
- break;
- case GlobalValue::HiddenVisibility:
- Visibility = STV_HIDDEN;
- break;
- case GlobalValue::ProtectedVisibility:
- Visibility = STV_PROTECTED;
- break;
- }
+ Visibility = getGvVisibility(GV);
}
SmallString<64> Name;
raw_svector_ostream OS(Name);
Sym.printName(OS);
StringRef NameRef = Saver.save(StringRef(Name));
+
SymbolBody *Body;
uint32_t Flags = Sym.getFlags();
bool IsWeak = Flags & BasicSymbolRef::SF_Weak;
More information about the llvm-commits
mailing list