Add --print-large-functions for checking which functions likely dominate the compile time.

This commit is contained in:
Christoffer Lerno
2026-02-16 00:13:19 +01:00
parent d7cf8fa9ab
commit a7309b217e
9 changed files with 30 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ void LLVMSetDSOLocal(LLVMValueRef Global, bool value);
void LLVMSetTargetMachineUseInitArray(LLVMTargetMachineRef ref, bool use_init_array);
void LLVMSetTargetMachineEmulatedTLS(LLVMTargetMachineRef ref, bool emulated_tls);
void LLVMSetNoSanitizeAddress(LLVMValueRef Global);
unsigned LLVMGetFunctionInstructionCount(LLVMValueRef function);
#ifdef __cplusplus
}

View File

@@ -341,6 +341,11 @@ void LLVMSetNoSanitizeAddress(LLVMValueRef Global)
global->setSanitizerMetadata(data);
}
unsigned LLVMGetFunctionInstructionCount(LLVMValueRef function)
{
auto func = llvm::unwrap<llvm::Function>(function);
return func->getInstructionCount();
}
void LLVMBuilderSetFastMathFlags(LLVMBuilderRef Builder, FastMathOption option)
{
llvm::FastMathFlags math_flags {};