Commit 7f1c3b26 authored by Brenden Blanco's avatar Brenden Blanco

Style fixes for loader.cc

Diff generated by clang-format
Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
parent 1e93ccf4
...@@ -213,7 +213,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -213,7 +213,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
// pre-compilation pass for generating tracepoint structures // pre-compilation pass for generating tracepoint structures
CompilerInstance compiler0; CompilerInstance compiler0;
CompilerInvocation &invocation0 = compiler0.getInvocation(); CompilerInvocation &invocation0 = compiler0.getInvocation();
if (!CompilerInvocation::CreateFromArgs(invocation0, const_cast<const char **>(ccargs.data()), if (!CompilerInvocation::CreateFromArgs(
invocation0, const_cast<const char **>(ccargs.data()),
const_cast<const char **>(ccargs.data()) + ccargs.size(), diags)) const_cast<const char **>(ccargs.data()) + ccargs.size(), diags))
return -1; return -1;
...@@ -224,7 +225,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -224,7 +225,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
if (in_memory) { if (in_memory) {
invocation0.getPreprocessorOpts().addRemappedFile(main_path, &*main_buf); invocation0.getPreprocessorOpts().addRemappedFile(main_path, &*main_buf);
invocation0.getFrontendOpts().Inputs.clear(); invocation0.getFrontendOpts().Inputs.clear();
invocation0.getFrontendOpts().Inputs.push_back(FrontendInputFile(main_path, IK_C)); invocation0.getFrontendOpts().Inputs.push_back(
FrontendInputFile(main_path, IK_C));
} }
invocation0.getFrontendOpts().DisableFree = false; invocation0.getFrontendOpts().DisableFree = false;
...@@ -240,7 +242,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -240,7 +242,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
// first pass // first pass
CompilerInstance compiler1; CompilerInstance compiler1;
CompilerInvocation &invocation1 = compiler1.getInvocation(); CompilerInvocation &invocation1 = compiler1.getInvocation();
if (!CompilerInvocation::CreateFromArgs(invocation1, const_cast<const char **>(ccargs.data()), if (!CompilerInvocation::CreateFromArgs(
invocation1, const_cast<const char **>(ccargs.data()),
const_cast<const char **>(ccargs.data()) + ccargs.size(), diags)) const_cast<const char **>(ccargs.data()) + ccargs.size(), diags))
return -1; return -1;
...@@ -252,7 +255,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -252,7 +255,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
invocation1.getPreprocessorOpts().addRemappedFile(f.first, &*f.second); invocation1.getPreprocessorOpts().addRemappedFile(f.first, &*f.second);
invocation1.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf); invocation1.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf);
invocation1.getFrontendOpts().Inputs.clear(); invocation1.getFrontendOpts().Inputs.clear();
invocation1.getFrontendOpts().Inputs.push_back(FrontendInputFile(main_path, IK_C)); invocation1.getFrontendOpts().Inputs.push_back(
FrontendInputFile(main_path, IK_C));
invocation1.getFrontendOpts().DisableFree = false; invocation1.getFrontendOpts().DisableFree = false;
compiler1.createDiagnostics(); compiler1.createDiagnostics();
...@@ -270,7 +274,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -270,7 +274,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
// second pass, clear input and take rewrite buffer // second pass, clear input and take rewrite buffer
CompilerInstance compiler2; CompilerInstance compiler2;
CompilerInvocation &invocation2 = compiler2.getInvocation(); CompilerInvocation &invocation2 = compiler2.getInvocation();
if (!CompilerInvocation::CreateFromArgs(invocation2, const_cast<const char **>(ccargs.data()), if (!CompilerInvocation::CreateFromArgs(
invocation2, const_cast<const char **>(ccargs.data()),
const_cast<const char **>(ccargs.data()) + ccargs.size(), diags)) const_cast<const char **>(ccargs.data()) + ccargs.size(), diags))
return -1; return -1;
invocation2.getPreprocessorOpts().RetainRemappedFileBuffers = true; invocation2.getPreprocessorOpts().RetainRemappedFileBuffers = true;
...@@ -278,7 +283,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes ...@@ -278,7 +283,8 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, unique_ptr<vector<TableDes
invocation2.getPreprocessorOpts().addRemappedFile(f.first, &*f.second); invocation2.getPreprocessorOpts().addRemappedFile(f.first, &*f.second);
invocation2.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf1); invocation2.getPreprocessorOpts().addRemappedFile(main_path, &*out_buf1);
invocation2.getFrontendOpts().Inputs.clear(); invocation2.getFrontendOpts().Inputs.clear();
invocation2.getFrontendOpts().Inputs.push_back(FrontendInputFile(main_path, IK_C)); invocation2.getFrontendOpts().Inputs.push_back(
FrontendInputFile(main_path, IK_C));
invocation2.getFrontendOpts().DisableFree = false; invocation2.getFrontendOpts().DisableFree = false;
// suppress warnings in the 2nd pass, but bail out on errors (our fault) // suppress warnings in the 2nd pass, but bail out on errors (our fault)
invocation2.getDiagnosticOpts().IgnoreWarnings = true; invocation2.getDiagnosticOpts().IgnoreWarnings = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment