From db78c30ba772af1466bb0d0c1d376c8e642ee4a9 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Tue, 9 Jan 2024 15:33:51 +0700 Subject: [RISCV] Deduplicate RISCVISAInfo::toFeatures/toFeatureVector. NFC (#76942) toFeatures and toFeatureVector both output a list of target feature flags, just with a slightly different interface. toFeatures keeps any unsupported extensions, and also provides a way to append negative extensions (AddAllExtensions=true). This patch combines them into one function, so that a later patch will be be able to get a std::vector of features that includes all the negative extensions, which was previously only possible through the StrAlloc interface. --- llvm/lib/Object/ELFObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/ELFObjectFile.cpp') diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 95c4f9f..ae21b81 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -315,7 +315,7 @@ Expected ELFObjectFileBase::getRISCVFeatures() const { else llvm_unreachable("XLEN should be 32 or 64."); - Features.addFeaturesVector(ISAInfo->toFeatureVector()); + Features.addFeaturesVector(ISAInfo->toFeatures()); } return Features; -- cgit v1.1