LEFT | RIGHT |
1 //===--- ExecuteCompilerInvocation.cpp ------------------------------------===// | 1 //===--- ExecuteCompilerInvocation.cpp ------------------------------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file holds ExecuteCompilerInvocation(). It is split into its own file to | 10 // This file holds ExecuteCompilerInvocation(). It is split into its own file to |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 const std::string &Path = Clang->getFrontendOpts().Plugins[i]; | 136 const std::string &Path = Clang->getFrontendOpts().Plugins[i]; |
137 std::string Error; | 137 std::string Error; |
138 if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error)) | 138 if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error)) |
139 Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin) | 139 Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin) |
140 << Path << Error; | 140 << Path << Error; |
141 } | 141 } |
142 | 142 |
143 //fprintf(stderr, "fyi: %s -> %s\n", Clang->getFrontendOpts().Inputs[0].second.c
_str(), Clang->getFrontendOpts().OutputFile.c_str()); | 143 //fprintf(stderr, "fyi: %s -> %s\n", Clang->getFrontendOpts().Inputs[0].second.c
_str(), Clang->getFrontendOpts().OutputFile.c_str()); |
144 // If there were errors in processing arguments, don't do anything else. | 144 // If there were errors in processing arguments, don't do anything else. |
145 bool Success = false; | 145 bool Success = false; |
146 if (!Clang->getDiagnostics().getNumErrors()) { | 146 if (!Clang->getDiagnostics().hasErrorOccurred()) { |
147 // Create and execute the frontend action. | 147 // Create and execute the frontend action. |
148 llvm::OwningPtr<FrontendAction> Act(CreateFrontendAction(*Clang)); | 148 llvm::OwningPtr<FrontendAction> Act(CreateFrontendAction(*Clang)); |
149 if (Act) { | 149 if (Act) { |
150 Success = Clang->ExecuteAction(*Act); | 150 Success = Clang->ExecuteAction(*Act); |
151 if (Clang->getFrontendOpts().DisableFree) | 151 if (Clang->getFrontendOpts().DisableFree) |
152 Act.take(); | 152 Act.take(); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 return Success; | 156 return Success; |
157 } | 157 } |
LEFT | RIGHT |