llvm5.0: use input kind helper to avoid breakage
Upstream llvm renamed an enum, so use a helper function that is
available in all versions to fix compatibility.
@@ -230,8 +230,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, TableStorage &ts, const st
if (in_memory) {
invocation0.getPreprocessorOpts().addRemappedFile(main_path, &*main_buf);
invocation0.getFrontendOpts().Inputs.clear();
- invocation0.getFrontendOpts().Inputs.push_back(
- FrontendInputFile(main_path, IK_C));
+ invocation0.getFrontendOpts().Inputs.push_back(FrontendInputFile(
+ main_path, FrontendOptions::getInputKindForExtension("c")));
}
invocation0.getFrontendOpts().DisableFree = false;
@@ -260,8 +260,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, TableStorage &ts, const st
invocation1.getPreprocessorOpts().addRemappedFile(f.first, &*f.second);
invocation1.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf);
invocation1.getFrontendOpts().Inputs.clear();
- invocation1.getFrontendOpts().Inputs.push_back(
- FrontendInputFile(main_path, IK_C));
+ invocation1.getFrontendOpts().Inputs.push_back(FrontendInputFile(
+ main_path, FrontendOptions::getInputKindForExtension("c")));
invocation1.getFrontendOpts().DisableFree = false;
compiler1.createDiagnostics();
@@ -286,8 +286,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, TableStorage &ts, const st
invocation2.getPreprocessorOpts().addRemappedFile(f.first, &*f.second);
invocation2.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf1);
invocation2.getFrontendOpts().Inputs.clear();
- invocation2.getFrontendOpts().Inputs.push_back(
- FrontendInputFile(main_path, IK_C));
+ invocation2.getFrontendOpts().Inputs.push_back(FrontendInputFile(
+ main_path, FrontendOptions::getInputKindForExtension("c")));
invocation2.getFrontendOpts().DisableFree = false;
// Resort to normal inlining. In -O0 the default is OnlyAlwaysInlining and
// clang might add noinline attribute even for functions with inline hint.
