|
LLDB mainline
|
#include "clang/AST/ASTContext.h"#include "clang/AST/ASTDiagnostic.h"#include "clang/AST/ExternalASTSource.h"#include "clang/AST/PrettyPrinter.h"#include "clang/Basic/Builtins.h"#include "clang/Basic/DarwinSDKInfo.h"#include "clang/Basic/DiagnosticIDs.h"#include "clang/Basic/IdentifierTable.h"#include "clang/Basic/SourceLocation.h"#include "clang/Basic/TargetInfo.h"#include "clang/Basic/Version.h"#include "clang/CodeGen/CodeGenAction.h"#include "clang/CodeGen/ModuleBuilder.h"#include "clang/Edit/Commit.h"#include "clang/Edit/EditedSource.h"#include "clang/Edit/EditsReceiver.h"#include "clang/Frontend/CompilerInstance.h"#include "clang/Frontend/CompilerInvocation.h"#include "clang/Frontend/FrontendActions.h"#include "clang/Frontend/FrontendDiagnostic.h"#include "clang/Frontend/FrontendPluginRegistry.h"#include "clang/Frontend/TextDiagnostic.h"#include "clang/Frontend/TextDiagnosticBuffer.h"#include "clang/Frontend/TextDiagnosticPrinter.h"#include "clang/Lex/Preprocessor.h"#include "clang/Parse/ParseAST.h"#include "clang/Rewrite/Core/Rewriter.h"#include "clang/Rewrite/Frontend/FrontendActions.h"#include "clang/Sema/CodeCompleteConsumer.h"#include "clang/Sema/Sema.h"#include "clang/Sema/SemaConsumer.h"#include "llvm/ADT/StringRef.h"#include "llvm/ExecutionEngine/ExecutionEngine.h"#include "llvm/Support/CrashRecoveryContext.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Error.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/TargetSelect.h"#include "llvm/TargetParser/Triple.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Module.h"#include "llvm/Support/DynamicLibrary.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/MemoryBuffer.h"#include "llvm/Support/Signals.h"#include "llvm/TargetParser/Host.h"#include "ClangDiagnostic.h"#include "ClangExpressionParser.h"#include "ClangUserExpression.h"#include "ASTUtils.h"#include "ClangASTSource.h"#include "ClangExpressionDeclMap.h"#include "ClangExpressionHelper.h"#include "ClangHost.h"#include "ClangModulesDeclVendor.h"#include "ClangPersistentVariables.h"#include "IRDynamicChecks.h"#include "IRForTarget.h"#include "ModuleDependencyCollector.h"#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"#include "lldb/Core/Debugger.h"#include "lldb/Core/Disassembler.h"#include "lldb/Core/Module.h"#include "lldb/Expression/DiagnosticManager.h"#include "lldb/Expression/IRExecutionUnit.h"#include "lldb/Expression/IRInterpreter.h"#include "lldb/Host/File.h"#include "lldb/Host/HostInfo.h"#include "lldb/Symbol/SymbolVendor.h"#include "lldb/Target/ExecutionContext.h"#include "lldb/Target/ExecutionContextScope.h"#include "lldb/Target/Language.h"#include "lldb/Target/Process.h"#include "lldb/Target/Target.h"#include "lldb/Target/ThreadPlanCallFunction.h"#include "lldb/Utility/DataBufferHeap.h"#include "lldb/Utility/LLDBAssert.h"#include "lldb/Utility/LLDBLog.h"#include "lldb/Utility/Log.h"#include "lldb/Utility/Stream.h"#include "lldb/Utility/StreamString.h"#include "lldb/Utility/StringList.h"#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"#include "Plugins/Platform/MacOSX/PlatformDarwin.h"#include "lldb/Utility/XcodeSDK.h"#include "lldb/lldb-enumerations.h"#include <cctype>#include <memory>#include <optional>#include "clang/Basic/TokenKinds.def"Go to the source code of this file.
Classes | |
| class | lldb_private::ClangExpressionParser::LLDBPreprocessorCallbacks |
| class | ClangDiagnosticManagerAdapter |
Macros | |
| #define | KEYWORD(NAME, FLAGS) |
Functions | |
| static void | AddAllFixIts (ClangDiagnostic *diag, const clang::Diagnostic &Info) |
| static void | SetupModuleHeaderPaths (CompilerInstance *compiler, std::vector< std::string > include_directories, lldb::TargetSP target_sp) |
| static void | RemoveCppKeyword (IdentifierTable &idents, llvm::StringRef token) |
| Iff the given identifier is a C++ keyword, remove it from the identifier table (i.e., make the token a normal identifier). | |
| static void | RemoveAllCppKeywords (IdentifierTable &idents) |
| Remove all C++ keywords from the given identifier table. | |
| static void | SetupDefaultClangDiagnostics (CompilerInstance &compiler) |
| Configures Clang diagnostics for the expression parser. | |
| static std::string | GetClangTargetABI (const ArchSpec &target_arch) |
| Returns a string representing current ABI. | |
| static void | SetupTargetOpts (CompilerInstance &compiler, lldb_private::Target const &target) |
| static void | SetupLangOpts (CompilerInstance &compiler, ExecutionContextScope &exe_scope, const Expression &expr, DiagnosticManager &diagnostic_manager) |
| static void | SetupImportStdModuleLangOpts (CompilerInstance &compiler, lldb_private::Target &target) |
| static void | ApplyFixIt (const FixItHint &fixit, clang::edit::Commit &commit) |
| Applies the given Fix-It hint to the given commit. | |
| static bool | FindFunctionInModule (ConstString &mangled_name, llvm::Module *module, const char *orig_name) |
| #define KEYWORD | ( | NAME, | |
| FLAGS ) |
|
static |
Definition at line 160 of file ClangExpressionParser.cpp.
References lldb_private::ClangDiagnostic::AddFixitHint().
Referenced by ClangDiagnosticManagerAdapter::HandleDiagnostic().
|
static |
Applies the given Fix-It hint to the given commit.
Definition at line 1366 of file ClangExpressionParser.cpp.
Referenced by lldb_private::ClangExpressionParser::RewriteExpression().
|
static |
Definition at line 1446 of file ClangExpressionParser.cpp.
References lldb_private::ConstString::SetString().
Referenced by lldb_private::ClangExpressionParser::DoPrepareForExecution().
|
static |
Returns a string representing current ABI.
| [in] | target_arch | The target architecture. |
Definition at line 406 of file ClangExpressionParser.cpp.
References lldb_private::ArchSpec::eLoongArch_abi_double_float, lldb_private::ArchSpec::eLoongArch_abi_mask, lldb_private::ArchSpec::eLoongArch_abi_single_float, lldb_private::ArchSpec::eLoongArch_abi_soft_float, lldb_private::ArchSpec::eMIPSABI_mask, lldb_private::ArchSpec::eMIPSABI_N32, lldb_private::ArchSpec::eMIPSABI_N64, lldb_private::ArchSpec::eMIPSABI_O32, lldb_private::ArchSpec::eRISCV_float_abi_double, lldb_private::ArchSpec::eRISCV_float_abi_mask, lldb_private::ArchSpec::eRISCV_float_abi_quad, lldb_private::ArchSpec::eRISCV_float_abi_single, lldb_private::ArchSpec::eRISCV_float_abi_soft, lldb_private::ArchSpec::eRISCV_rve, lldb_private::ArchSpec::GetFlags(), lldb_private::ArchSpec::GetTriple(), and lldb_private::ArchSpec::IsMIPS().
Referenced by SetupTargetOpts().
|
static |
Remove all C++ keywords from the given identifier table.
Definition at line 379 of file ClangExpressionParser.cpp.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().
|
static |
Iff the given identifier is a C++ keyword, remove it from the identifier table (i.e., make the token a normal identifier).
Definition at line 351 of file ClangExpressionParser.cpp.
|
static |
Configures Clang diagnostics for the expression parser.
Definition at line 385 of file ClangExpressionParser.cpp.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().
|
static |
Definition at line 693 of file ClangExpressionParser.cpp.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().
|
static |
Definition at line 532 of file ClangExpressionParser.cpp.
References lldb_private::DiagnosticManager::AddDiagnostic(), lldb_private::SourceLanguage::AsLanguageType(), lldb_private::ExecutionContextScope::CalculateProcess(), lldb_private::ExecutionContextScope::CalculateStackFrame(), lldb_private::ArchSpec::CharIsSignedByDefault(), lldb_private::Expression::DesiredResultType(), lldb_private::ObjCLanguageRuntime::eAppleObjC_V1, lldb_private::ObjCLanguageRuntime::eAppleObjC_V2, lldb_private::eDiagnosticOriginLLDB, lldb_private::ObjCLanguageRuntime::eGNUstep_libobjc2, lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, lldb::eLanguageTypeC99, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, lldb::eLanguageTypeC_plus_plus_17, lldb::eLanguageTypeC_plus_plus_20, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, lldb::eLanguageTypeUnknown, lldb_private::ObjCLanguageRuntime::eObjC_VersionUnknown, lldb_private::Expression::eResultTypeId, lldb::eSeverityInfo, lldb_private::Expressions, lldb_private::ObjCLanguageRuntime::Get(), lldb_private::Language::GetDisplayNameForLanguageType(), lldb_private::GetLog(), lldb_private::Language::GetNameForLanguageType(), lldb_private::Expression::Language(), and LLDB_LOG.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().
|
static |
Definition at line 326 of file ClangExpressionParser.cpp.
References lldb_private::Expressions, lldb_private::GetClangResourceDir(), lldb_private::ModuleList::GetGlobalModuleListProperties(), lldb_private::GetLog(), lldb_private::FileSpec::GetPath(), and LLDB_LOG.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().
|
static |
Definition at line 466 of file ClangExpressionParser.cpp.
References lldb_private::Expressions, lldb_private::Target::GetArchitecture(), GetClangTargetABI(), lldb_private::ArchSpec::GetClangTargetCPU(), lldb_private::GetLog(), lldb_private::ArchSpec::GetMachine(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArchSpec::IsValid(), and LLDB_LOGF.
Referenced by lldb_private::ClangExpressionParser::ClangExpressionParser().