Skip to content

Commit 1408ee2

Browse files
Assert symbol name, add comment about symbol naming
1 parent 9dfa6f5 commit 1408ee2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/tools/llvm-exegesis/lib/Assembler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ Expected<ExecutableFunction> ExecutableFunction::create(
332332
std::unique_ptr<LLVMContext> Ctx = std::make_unique<LLVMContext>();
333333

334334
auto SymbolSizes = object::computeSymbolSizes(*ObjectFileHolder.getBinary());
335+
// Get the size of the function that we want to call into (with the name of
336+
// FunctionID). This should always be the third symbol returned by
337+
// calculateSymbolSizes.
335338
assert(SymbolSizes.size() == 3);
339+
assert(cantFail(std::get<0>(SymbolSizes[2]).getName()) == FunctionID);
336340
uintptr_t CodeSize = std::get<1>(SymbolSizes[2]);
337341

338342
auto EJITOrErr = orc::LLJITBuilder().create();

0 commit comments

Comments
 (0)