[lldb][LoongArch] Function calls support in lldb expressions

This patch adds desired feature flags in JIT compiler to enable
hard-float instructions if target supports them and allows to use floats
and doubles in lldb expressions.

Fited tests:
lldb-shell :: Expr/TestAnonNamespaceParamFunc.cpp
lldb-shell :: Expr/TestIRMemoryMap.test
lldb-shell :: Expr/TestStringLiteralExpr.test
lldb-shell :: SymbolFile/DWARF/debug-types-expressions.test

Similar as #99336
Depens on: https://github.com/llvm/llvm-project/pull/114741

Reviewed By: SixWeining

Pull Request: https://github.com/llvm/llvm-project/pull/114742
This commit is contained in:
wanglei
2024-11-08 10:43:57 +08:00
committed by GitHub
parent 4e668d5b27
commit 1c8fca82a0
7 changed files with 840 additions and 1 deletions

View File

@@ -1436,6 +1436,23 @@ size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl &section_headers,
arch_spec.SetFlags(flags);
}
if (arch_spec.GetMachine() == llvm::Triple::loongarch32 ||
arch_spec.GetMachine() == llvm::Triple::loongarch64) {
uint32_t flags = arch_spec.GetFlags();
switch (header.e_flags & llvm::ELF::EF_LOONGARCH_ABI_MODIFIER_MASK) {
case llvm::ELF::EF_LOONGARCH_ABI_SINGLE_FLOAT:
flags |= ArchSpec::eLoongArch_abi_single_float;
break;
case llvm::ELF::EF_LOONGARCH_ABI_DOUBLE_FLOAT:
flags |= ArchSpec::eLoongArch_abi_double_float;
break;
case llvm::ELF::EF_LOONGARCH_ABI_SOFT_FLOAT:
break;
}
arch_spec.SetFlags(flags);
}
// If there are no section headers we are done.
if (header.e_shnum == 0)
return 0;