[PATCH] D146604: [NFC] Fix uninitalized member variable use in ASTReader::ParseTargetOptions()

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 22 12:22:33 PDT 2023


tahonermann added inline comments.


================
Comment at: clang/include/clang/Basic/TargetOptions.h:48
   /// The EABI version to use
-  llvm::EABI EABIVersion;
+  llvm::EABI EABIVersion = llvm::EABI::Default;
 
----------------
Looks good; this is consistent with the default initialization performed for `llvm::TargetOptions::EABIVersion`.


================
Comment at: clang/include/clang/Basic/TargetOptions.h:91
   /// \brief Code object version for AMDGPU.
-  CodeObjectVersionKind CodeObjectVersion;
+  CodeObjectVersionKind CodeObjectVersion = CodeObjectVersionKind::COV_4;
 
----------------
I see that `COV_4` is the default as specified in `clang/include/clang/Driver/Options.td`, but I wonder if we want to duplicate that value here. I'm a bit more inclined to default to `COV_None` so that we're not trying to maintain the same default in multiple places. I don't know that it matters though.

Perhaps it would make sense to add a "default" option value as is done for EABI? I'm not sure.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146604/new/

https://reviews.llvm.org/D146604



More information about the cfe-commits mailing list