// Split dwarf information (GCC 4.8 and up). Contains pathname if not empty.
std::string output_dwo;
+ // The .gch/.pch/.pth file used for compilation.
+ std::string included_pch_file;
+
// Language to use for the compilation target (see language.c).
std::string actual_language;
// The name of the cpp stderr file.
std::string cpp_stderr;
- // The .gch/.pch/.pth file used for compilation.
- std::string included_pch_file;
-
// Headers (or directories with headers) to ignore in manifest mode.
std::vector<std::string> ignore_header_paths;
}
bool
-detect_pch(Context& ctx,
- const std::string& option,
+detect_pch(const std::string& option,
const std::string& arg,
+ std::string& included_pch_file,
bool is_cc1_option,
bool* found_pch)
{
}
if (!pch_file.empty()) {
- if (!ctx.included_pch_file.empty()) {
+ if (!included_pch_file.empty()) {
LOG("Multiple precompiled headers used: {} and {}",
- ctx.included_pch_file,
+ included_pch_file,
pch_file);
return false;
}
- ctx.included_pch_file = pch_file;
+ included_pch_file = pch_file;
*found_pch = true;
}
return true;
next = 2;
}
- if (!detect_pch(
- ctx, args[i], args[i + next], next == 2, &state.found_pch)) {
+ if (!detect_pch(args[i],
+ args[i + next],
+ args_info.included_pch_file,
+ next == 2,
+ &state.found_pch)) {
return Statistic::bad_compiler_arguments;
}
Hash fhash;
if (is_pch) {
- if (ctx.included_pch_file.empty()) {
+ if (ctx.args_info.included_pch_file.empty()) {
LOG("Detected use of precompiled header: {}", path);
}
bool using_pch_sum = false;
// Explicitly check the .gch/.pch/.pth file as Clang does not include any
// mention of it in the preprocessed output.
- if (!ctx.included_pch_file.empty()) {
- std::string pch_path = Util::make_relative_path(ctx, ctx.included_pch_file);
+ if (!ctx.args_info.included_pch_file.empty()) {
+ std::string pch_path =
+ Util::make_relative_path(ctx, ctx.args_info.included_pch_file);
hash.hash(pch_path);
remember_include_file(ctx, pch_path, hash, false, nullptr);
}
// Explicitly check the .gch/.pch/.pth file as it may not be mentioned in the
// dependencies output.
- if (!ctx.included_pch_file.empty()) {
- std::string pch_path = Util::make_relative_path(ctx, ctx.included_pch_file);
+ if (!ctx.args_info.included_pch_file.empty()) {
+ std::string pch_path =
+ Util::make_relative_path(ctx, ctx.args_info.included_pch_file);
hash.hash(pch_path);
remember_include_file(ctx, pch_path, hash, false, nullptr);
}