[llvm-branch-commits] [llvm] 1408ee2 - Assert symbol name, add comment about symbol naming
Aiden Grossman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Nov 24 02:03:36 PST 2023
Author: Aiden Grossman
Date: 2023-11-24T02:03:29-08:00
New Revision: 1408ee2eedd4af7cbf94d6e7570c0272e92a8846
URL: https://github.com/llvm/llvm-project/commit/1408ee2eedd4af7cbf94d6e7570c0272e92a8846
DIFF: https://github.com/llvm/llvm-project/commit/1408ee2eedd4af7cbf94d6e7570c0272e92a8846.diff
LOG: Assert symbol name, add comment about symbol naming
Added:
Modified:
llvm/tools/llvm-exegesis/lib/Assembler.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
index 54ba29ed04c6f95..903ecbe47b8da0f 100644
--- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
@@ -332,7 +332,11 @@ Expected<ExecutableFunction> ExecutableFunction::create(
std::unique_ptr<LLVMContext> Ctx = std::make_unique<LLVMContext>();
auto SymbolSizes = object::computeSymbolSizes(*ObjectFileHolder.getBinary());
+ // Get the size of the function that we want to call into (with the name of
+ // FunctionID). This should always be the third symbol returned by
+ // calculateSymbolSizes.
assert(SymbolSizes.size() == 3);
+ assert(cantFail(std::get<0>(SymbolSizes[2]).getName()) == FunctionID);
uintptr_t CodeSize = std::get<1>(SymbolSizes[2]);
auto EJITOrErr = orc::LLJITBuilder().create();
More information about the llvm-branch-commits
mailing list