================ @@ -1446,6 +1446,33 @@ bool DisassemblerLLVMC::MCDisasmInstance::IsAuthenticated( return InstrDesc.isAuthenticated() || IsBrkC47x; } +void DisassemblerLLVMC::UpdateFeatureString(llvm::StringRef additional_features, + std::string &features) { + // Allow users to override default additional features. + for (llvm::StringRef flag : llvm::split(additional_features, ",")) { + flag = flag.trim(); + if (flag.empty()) + continue; + // By default, if both +flag and -flag are present in the feature string, + // disassembler keeps the feature enabled (+flag). + // To respect user intent, we make -flag(user) take priority over the + // default +flag coming from ELF. + bool add_flag = true; + if (flag.starts_with('+')) { + std::string disable_flag = "-" + flag.substr(1).str(); ---------------- DavidSpickett wrote:
If flag starts with plus and it's at least two characters, only then do the rest. https://github.com/llvm/llvm-project/pull/147990 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits