[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

Tomas Matheson via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 06:57:24 PDT 2024


================
@@ -161,6 +162,39 @@ static int PrintSupportedExtensions(std::string TargetStr) {
   return 0;
 }
 
+static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
+  std::string Error;
+  const llvm::Target *TheTarget =
+      llvm::TargetRegistry::lookupTarget(TargetOpts.Triple, Error);
+  if (!TheTarget) {
+    llvm::errs() << Error;
+    return 1;
+  }
+
+  llvm::TargetOptions BackendOptions;
----------------
tmatheson-arm wrote:

What is the difference between this and `TargetOpts`? This section maybe needs a comment explaining what is going on.

https://github.com/llvm/llvm-project/pull/95805


More information about the cfe-commits mailing list