[llvm-branch-commits] [lldb] [lldb][RISCV] update RISCV target features in expressions (PR #173048)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Dec 19 08:48:58 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: None (daniilavdeev)
<details>
<summary>Changes</summary>
This patch updates CompilerInstance initialization to use SubtargetFeatures from ArchSpec.
---
Full diff: https://github.com/llvm/llvm-project/pull/173048.diff
1 Files Affected:
- (modified) lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (+6)
``````````diff
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index eb47082a70552..3cce39fc81b6a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -499,6 +499,12 @@ static void SetupTargetOpts(CompilerInstance &compiler,
compiler.getTargetOpts().FeaturesAsWritten.push_back("+sse2");
}
+ if (target_machine == llvm::Triple::riscv32 ||
+ target_machine == llvm::Triple::riscv64) {
+ llvm::copy(target_arch.GetSubtargetFeatures().getFeatures(),
+ std::back_inserter(compiler.getTargetOpts().FeaturesAsWritten));
+ }
+
// Set the target CPU to generate code for. This will be empty for any CPU
// that doesn't really need to make a special
// CPU string.
``````````
</details>
https://github.com/llvm/llvm-project/pull/173048
More information about the llvm-branch-commits
mailing list