Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[cxxmodules] Extended InvocationOptions with C++ modules flags.
This makes it easier for cling to check if -fmodules and/or
-fmodule-name is passed so that we can act on these flags in the
CIFactory.
  • Loading branch information
Teemperor committed Sep 14, 2017
commit 9d975897d114d9c3a91da51a649058b1da38ea53
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ namespace cling {
unsigned StdLib : 1;
unsigned HasOutput : 1;
unsigned Verbose : 1;
unsigned CxxModules : 1;
/// \brief The output path of any C++ PCMs we're building on demand.
/// Equal to ModuleCachePath in the HeaderSearchOptions.
std::string CachePath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you throw in what you're caching, I guess ModuleCachePath?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

// If not empty, the name of the module we're currently compiling.
std::string ModuleName;

///\brief The remaining arguments to pass to clang.
///
Expand Down
12 changes: 8 additions & 4 deletions interpreter/cling/lib/Interpreter/InvocationOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ static const char kNoStdInc[] = "-nostdinc";
}
}

CompilerOptions::CompilerOptions(int argc, const char* const* argv) :
Language(false), ResourceDir(false), SysRoot(false), NoBuiltinInc(false),
NoCXXInc(false), StdVersion(false), StdLib(false), HasOutput(false),
Verbose(false) {
CompilerOptions::CompilerOptions(int argc, const char* const* argv)
: Language(false), ResourceDir(false), SysRoot(false), NoBuiltinInc(false),
NoCXXInc(false), StdVersion(false), StdLib(false), HasOutput(false),
Verbose(false), CxxModules(false) {
if (argc && argv) {
// Preserve what's already in Remaining, the user might want to push args
// to clang while still using main's argc, argv
Expand Down Expand Up @@ -136,6 +136,10 @@ void CompilerOptions::Parse(int argc, const char* const argv[],
// case options::OPT_nostdinc:
case options::OPT_nostdincxx: NoCXXInc = true; break;
case options::OPT_v: Verbose = true; break;
case options::OPT_fmodules: CxxModules = true; break;
case options::OPT_fmodule_name_EQ: LLVM_FALLTHROUGH;
case options::OPT_fmodule_name: ModuleName = arg->getValue(); break;
case options::OPT_fmodules_cache_path: CachePath = arg->getValue(); break;

default:
if (Inputs && arg->getOption().getKind() == Option::InputClass)
Expand Down