Index: flang/tools/bbc/bbc.cpp =================================================================== --- flang/tools/bbc/bbc.cpp +++ flang/tools/bbc/bbc.cpp @@ -185,6 +185,10 @@ llvm::cl::desc("Lower to high level FIR"), llvm::cl::init(false)); +static llvm::cl::opt enableCUDA("fcuda", + llvm::cl::desc("enable CUDA Fortran"), + llvm::cl::init(false)); + #define FLANG_EXCLUDE_CODEGEN #include "flang/Tools/CLOptions.inc" @@ -401,6 +405,12 @@ options.predefinitions.emplace_back("_OPENACC", "202211"); } + // enable parsing of CUDA Fortran + if (enableCUDA) { + options.features.Enable(Fortran::common::LanguageFeature::CUDA); + options.predefinitions.emplace_back("_CUDA", "1"); + } + Fortran::common::IntrinsicTypeDefaultKinds defaultKinds; Fortran::parser::AllSources allSources; Fortran::parser::AllCookedSources allCookedSources(allSources);