@@ -219,11 +219,6 @@ static cl::opt<bool>
219219 SPIRVMemToReg (" spirv-mem2reg" , cl::init(false ),
220220 cl::desc(" LLVM/SPIR-V translation enable mem2reg" ));
221221
222- static cl::opt<bool >
223- SPIRVPreserveAuxData (" spirv-preserve-auxdata" , cl::init(false ),
224- cl::desc(" Preserve all auxiliary data, such as "
225- " function attributes and metadata" ));
226-
227222static cl::opt<bool > SpecConstInfo (
228223 " spec-const-info" ,
229224 cl::desc (" Display id of constants available for specializaion and their "
@@ -836,12 +831,22 @@ int main(int Ac, char **Av) {
836831 OptToDisable->setArgStr (" spirv-ext-coming-from-spirv-backend" );
837832 OptToDisable->setHiddenFlag (cl::Hidden);
838833 }
834+ if (RegisteredOptions.count (" spirv-preserve-auxdata" ) == 1 ) {
835+ llvm::cl::Option *OptToDisable =
836+ RegisteredOptions[" spirv-preserve-auxdata" ];
837+ OptToDisable->setArgStr (" spirv-preserve-auxdata-coming-from-spirv-backend" );
838+ OptToDisable->setHiddenFlag (cl::Hidden);
839+ }
839840#endif
840841 cl::list<std::string> SPVExt (
841842 " spirv-ext" , cl::CommaSeparated,
842843 cl::desc (" Specify list of allowed/disallowed extensions" ),
843844 cl::value_desc (" +SPV_extenstion1_name,-SPV_extension2_name" ),
844845 cl::ValueRequired);
846+ cl::opt<bool > SPIRVPreserveAuxData (
847+ " spirv-preserve-auxdata" , cl::init (false ),
848+ cl::desc (" Preserve all auxiliary data, such as function attributes and "
849+ " metadata" ));
845850
846851 cl::ParseCommandLineOptions (Ac, Av, " LLVM/SPIR-V translator" );
847852
0 commit comments