|
16 | 16 | #include "clang/Basic/Version.h"
|
17 | 17 | #include "clang/CodeGen/CodeGenAction.h"
|
18 | 18 | #include "clang/CodeGen/ModuleBuilder.h"
|
19 |
| -#include "clang/CodeGen/ObjectFilePCHContainerOperations.h" |
20 | 19 | #include "clang/Edit/Commit.h"
|
21 | 20 | #include "clang/Edit/EditedSource.h"
|
22 | 21 | #include "clang/Edit/EditsReceiver.h"
|
|
27 | 26 | #include "clang/Frontend/FrontendPluginRegistry.h"
|
28 | 27 | #include "clang/Frontend/TextDiagnosticBuffer.h"
|
29 | 28 | #include "clang/Frontend/TextDiagnosticPrinter.h"
|
30 |
| -#include "clang/Lex/HeaderSearch.h" |
31 | 29 | #include "clang/Lex/Preprocessor.h"
|
32 | 30 | #include "clang/Parse/ParseAST.h"
|
33 | 31 | #include "clang/Rewrite/Core/Rewriter.h"
|
@@ -213,50 +211,6 @@ class ClangDiagnosticManagerAdapter : public clang::DiagnosticConsumer {
|
213 | 211 | std::shared_ptr<clang::TextDiagnosticBuffer> m_passthrough;
|
214 | 212 | };
|
215 | 213 |
|
216 |
| -class LoggingDiagnosticConsumer : public clang::DiagnosticConsumer { |
217 |
| -public: |
218 |
| - LoggingDiagnosticConsumer() { |
219 |
| - m_log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS); |
220 |
| - m_passthrough.reset(new clang::TextDiagnosticBuffer); |
221 |
| - } |
222 |
| - |
223 |
| - LoggingDiagnosticConsumer( |
224 |
| - const std::shared_ptr<clang::TextDiagnosticBuffer> &passthrough) { |
225 |
| - m_log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS); |
226 |
| - m_passthrough = passthrough; |
227 |
| - } |
228 |
| - |
229 |
| - void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, |
230 |
| - const clang::Diagnostic &Info) { |
231 |
| - if (m_log) { |
232 |
| - llvm::SmallVector<char, 32> diag_str; |
233 |
| - Info.FormatDiagnostic(diag_str); |
234 |
| - diag_str.push_back('\0'); |
235 |
| - const char *data = diag_str.data(); |
236 |
| - m_log->Printf("[clang] COMPILER DIAGNOSTIC: %s", data); |
237 |
| - |
238 |
| - lldbassert(Info.getID() != clang::diag::err_unsupported_ast_node && |
239 |
| - "'log enable lldb expr' to investigate."); |
240 |
| - } |
241 |
| - |
242 |
| - m_passthrough->HandleDiagnostic(DiagLevel, Info); |
243 |
| - } |
244 |
| - |
245 |
| - void FlushDiagnostics(DiagnosticsEngine &Diags) { |
246 |
| - m_passthrough->FlushDiagnostics(Diags); |
247 |
| - } |
248 |
| - |
249 |
| - DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const { |
250 |
| - return new LoggingDiagnosticConsumer(m_passthrough); |
251 |
| - } |
252 |
| - |
253 |
| - clang::TextDiagnosticBuffer *GetPassthrough() { return m_passthrough.get(); } |
254 |
| - |
255 |
| -private: |
256 |
| - Log *m_log; |
257 |
| - std::shared_ptr<clang::TextDiagnosticBuffer> m_passthrough; |
258 |
| -}; |
259 |
| - |
260 | 214 | //===----------------------------------------------------------------------===//
|
261 | 215 | // Implementation of ClangExpressionParser
|
262 | 216 | //===----------------------------------------------------------------------===//
|
@@ -309,15 +263,6 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
|
309 | 263 | m_compiler->setVirtualFileSystem(
|
310 | 264 | FileSystem::Instance().GetVirtualFileSystem());
|
311 | 265 |
|
312 |
| - // Register the support for object-file-wrapped Clang modules. |
313 |
| - std::shared_ptr<clang::PCHContainerOperations> pch_operations = |
314 |
| - m_compiler->getPCHContainerOperations(); |
315 |
| - pch_operations->registerWriter( |
316 |
| - llvm::make_unique<ObjectFilePCHContainerWriter>()); |
317 |
| - pch_operations->registerReader( |
318 |
| - llvm::make_unique<ObjectFilePCHContainerReader>()); |
319 |
| - |
320 |
| - // 2. Install the target. |
321 | 266 | lldb::LanguageType frame_lang =
|
322 | 267 | expr.Language(); // defaults to lldb::eLanguageTypeUnknown
|
323 | 268 | bool overridden_target_opts = false;
|
@@ -367,9 +312,6 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
|
367 | 312 | log->Printf("Using default target triple of %s",
|
368 | 313 | m_compiler->getTargetOpts().Triple.c_str());
|
369 | 314 | }
|
370 |
| - |
371 |
| - m_compiler->getTargetOpts().CPU = ""; |
372 |
| - |
373 | 315 | // Now add some special fixes for known architectures: Any arm32 iOS
|
374 | 316 | // environment, but not on arm64
|
375 | 317 | if (m_compiler->getTargetOpts().Triple.find("arm64") == std::string::npos &&
|
@@ -1145,17 +1087,6 @@ lldb_private::Status ClangExpressionParser::PrepareForExecution(
|
1145 | 1087 | return err;
|
1146 | 1088 | }
|
1147 | 1089 |
|
1148 |
| - for (llvm::Function &function : *llvm_module_up.get()) { |
1149 |
| - llvm::AttributeList attributes = function.getAttributes(); |
1150 |
| - llvm::AttrBuilder attributes_to_remove; |
1151 |
| - |
1152 |
| - attributes_to_remove.addAttribute("target-cpu"); |
1153 |
| - |
1154 |
| - function.setAttributes(attributes.removeAttributes( |
1155 |
| - function.getContext(), llvm::AttributeList::FunctionIndex, |
1156 |
| - attributes_to_remove)); |
1157 |
| - } |
1158 |
| - |
1159 | 1090 | ConstString function_name;
|
1160 | 1091 |
|
1161 | 1092 | if (execution_policy != eExecutionPolicyTopLevel) {
|
|
0 commit comments