summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--contrib/llvm/lib/Object/IRObjectFile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/llvm/lib/Object/IRObjectFile.cpp b/contrib/llvm/lib/Object/IRObjectFile.cpp
index 9f5132e..c35c413 100644
--- a/contrib/llvm/lib/Object/IRObjectFile.cpp
+++ b/contrib/llvm/lib/Object/IRObjectFile.cpp
@@ -219,6 +219,12 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
uint32_t Res = BasicSymbolRef::SF_None;
if (GV->isDeclarationForLinker())
Res |= BasicSymbolRef::SF_Undefined;
+ else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage())
+ Res |= BasicSymbolRef::SF_Hidden;
+ if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
+ if (GVar->isConstant())
+ Res |= BasicSymbolRef::SF_Const;
+ }
if (GV->hasPrivateLinkage())
Res |= BasicSymbolRef::SF_FormatSpecific;
if (!GV->hasLocalLinkage())
@@ -303,7 +309,7 @@ llvm::object::IRObjectFile::create(MemoryBufferRef Object,
MemoryBuffer::getMemBuffer(BCOrErr.get(), false));
ErrorOr<std::unique_ptr<Module>> MOrErr =
- getLazyBitcodeModule(std::move(Buff), Context, nullptr,
+ getLazyBitcodeModule(std::move(Buff), Context,
/*ShouldLazyLoadMetadata*/ true);
if (std::error_code EC = MOrErr.getError())
return EC;
OpenPOWER on IntegriCloud