Skip to content

Commit f74d424

Browse files
committed
add comments
1 parent c11b614 commit f74d424

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/lib/ExecutionEngine/JITLink/XCOFFLinkGraphBuilder.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,13 @@ Error XCOFFLinkGraphBuilder::processCsectsAndSymbols() {
310310
B = CsectTable[CsectSymbolIndex];
311311
}
312312

313-
Scope S{Scope::Default};
313+
Scope S{Scope::Local};
314314
if (Hidden)
315315
S = Scope::Hidden;
316-
// TODO: Got this from llvm-objdump.cpp:2938 not sure if its correct
317-
if (!Weak) {
318-
if (Global)
319-
S = Scope::Default;
320-
else
321-
S = Scope::Local;
322-
}
316+
else if (Global)
317+
S = Scope::Default;
318+
// TODO: map all symbols for c++ static initialization to SideEffectOnly
323319

324-
// TODO: figure out all symbols that should have Scope::SideEffectsOnly
325320
Linkage L = Weak ? Linkage::Weak : Linkage::Strong;
326321
auto SymbolAddr = Symbol.getAddress();
327322
if (!SymbolAddr)

llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,17 @@ getXCOFFObjectFileSymbolInfo(ExecutionSession &ES,
261261
if (!SymFlags)
262262
return SymFlags.takeError();
263263

264-
// TODO: Global symbols should have default visibility for now
264+
// By default, only shared library with F_SHROBJ in the xcoff header will
265+
// have SF_Exported. On AIX, we require the linker with the help of an
266+
// export list to determine the visibility of the symbol. This mimics the
267+
// behaviour of -bautoexp and CreateExportList utilities. In the abscence of
268+
// the export list, this is the best we can do.
269+
// TODO: Revisit
265270
*SymFlags |= JITSymbolFlags::Exported;
266271

267272
I.SymbolFlags[ES.intern(std::move(*Name))] = std::move(*SymFlags);
268273
}
269-
// TODO: Implement init sections
274+
// TODO: Find all initialization symbols for c++ static initializers
270275
return I;
271276
}
272277

0 commit comments

Comments
 (0)