[llvm-branch-commits] [llvm] b76d51e - 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:17:40 PST 2023


Author: Aiden Grossman
Date: 2023-11-24T02:17:07-08:00
New Revision: b76d51ee7c4bbc942e2860ab5fc0383f7a0d2fe1

URL: https://github.com/llvm/llvm-project/commit/b76d51ee7c4bbc942e2860ab5fc0383f7a0d2fe1
DIFF: https://github.com/llvm/llvm-project/commit/b76d51ee7c4bbc942e2860ab5fc0383f7a0d2fe1.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