[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 07:32:52 PDT 2023
tahonermann added inline comments.
================
Comment at: clang/lib/Serialization/ASTReader.cpp:5890-5892
+ TargetOpts.EABIVersion = llvm::EABI::Default;
+ // Initialize CodeObjectVersion with default i.e., 4
+ TargetOpts.CodeObjectVersion = TargetOptions::CodeObjectVersionKind::COV_4;
----------------
It is odd that these values aren't preserved by the AST writer. I wonder if that is intentional.
It took me a while, but I eventually found that these data members are assigned via an inclusion of `clang/Driver/Options.inc` somewhere.
Rather than assigning values here, I think we would be better off adding member initializers in the class definition. But I think we do need to look into why the AST writer isn't preserving the values.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146604/new/
https://reviews.llvm.org/D146604
More information about the cfe-commits
mailing list