本文整理汇总了C++中Process::GetObjCLanguageRuntime方法的典型用法代码示例。如果您正苦于以下问题:C++ Process::GetObjCLanguageRuntime方法的具体用法?C++ Process::GetObjCLanguageRuntime怎么用?C++ Process::GetObjCLanguageRuntime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::GetObjCLanguageRuntime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
DynamicCheckerFunctions::Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx)
{
Error error;
m_valid_pointer_check.reset(exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(g_valid_pointer_check_text,
lldb::eLanguageTypeC,
VALID_POINTER_CHECK_NAME,
error));
if (error.Fail())
return false;
if (!m_valid_pointer_check->Install(diagnostic_manager, exe_ctx))
return false;
Process *process = exe_ctx.GetProcessPtr();
if (process)
{
ObjCLanguageRuntime *objc_language_runtime = process->GetObjCLanguageRuntime();
if (objc_language_runtime)
{
m_objc_object_check.reset(objc_language_runtime->CreateObjectChecker(VALID_OBJC_OBJECT_CHECK_NAME));
if (!m_objc_object_check->Install(diagnostic_manager, exe_ctx))
return false;
}
}
return true;
}
示例2: ClangUtilityFunction
bool
DynamicCheckerFunctions::Install(Stream &error_stream,
ExecutionContext &exe_ctx)
{
m_valid_pointer_check.reset(new ClangUtilityFunction(g_valid_pointer_check_text,
VALID_POINTER_CHECK_NAME));
if (!m_valid_pointer_check->Install(error_stream, exe_ctx))
return false;
Process *process = exe_ctx.GetProcessPtr();
if (process)
{
ObjCLanguageRuntime *objc_language_runtime = process->GetObjCLanguageRuntime();
if (objc_language_runtime)
{
m_objc_object_check.reset(objc_language_runtime->CreateObjectChecker(VALID_OBJC_OBJECT_CHECK_NAME));
if (!m_objc_object_check->Install(error_stream, exe_ctx))
return false;
}
}
return true;
}
示例3: key_cs
bool
Find_Impl (ExecutionContextScope *exe_scope,
const char *key,
ResultSet &results) override
{
bool result = false;
Target* target = exe_scope->CalculateTarget().get();
if (target)
{
if (auto clang_modules_decl_vendor = target->GetClangModulesDeclVendor())
{
std::vector <clang::NamedDecl*> decls;
ConstString key_cs(key);
if (clang_modules_decl_vendor->FindDecls(key_cs, false, UINT32_MAX, decls) > 0 &&
!decls.empty())
{
CompilerType module_type = ClangASTContext::GetTypeForDecl(decls.front());
result = true;
std::unique_ptr<Language::TypeScavenger::Result> result(new ObjCScavengerResult(module_type));
results.insert(std::move(result));
}
}
}
if (!result)
{
Process* process = exe_scope->CalculateProcess().get();
if (process)
{
const bool create_on_demand = false;
auto objc_runtime = process->GetObjCLanguageRuntime(create_on_demand);
if (objc_runtime)
{
auto decl_vendor = objc_runtime->GetDeclVendor();
if (decl_vendor)
{
std::vector<clang::NamedDecl *> decls;
ConstString name(key);
decl_vendor->FindDecls(name, true, UINT32_MAX, decls);
for (auto decl : decls)
{
if (decl)
{
if (CompilerType candidate = ClangASTContext::GetTypeForDecl(decl))
{
result = true;
std::unique_ptr<Language::TypeScavenger::Result> result(new ObjCScavengerResult(candidate));
results.insert(std::move(result));
}
}
}
}
}
}
}
return result;
}
示例4: module_name
ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
ClangExpression &expr) :
m_expr (expr),
m_compiler (),
m_code_generator (NULL),
m_execution_engine (),
m_jitted_functions ()
{
// Initialize targets first, so that --version shows registered targets.
static struct InitializeLLVM {
InitializeLLVM() {
llvm::InitializeAllTargets();
llvm::InitializeAllAsmPrinters();
}
} InitializeLLVM;
// 1. Create a new compiler instance.
m_compiler.reset(new CompilerInstance());
m_compiler->setLLVMContext(new LLVMContext());
// 2. Set options.
// Parse expressions as Objective C++ regardless of context.
// Our hook into Clang's lookup mechanism only works in C++.
m_compiler->getLangOpts().CPlusPlus = true;
// Setup objective C
m_compiler->getLangOpts().ObjC1 = true;
m_compiler->getLangOpts().ObjC2 = true;
Process *process = NULL;
if (exe_scope)
process = exe_scope->CalculateProcess();
if (process)
{
if (process->GetObjCLanguageRuntime())
{
if (process->GetObjCLanguageRuntime()->GetRuntimeVersion() == lldb::eAppleObjC_V2)
{
m_compiler->getLangOpts().ObjCNonFragileABI = true; // NOT i386
m_compiler->getLangOpts().ObjCNonFragileABI2 = true; // NOT i386
}
}
}
m_compiler->getLangOpts().ThreadsafeStatics = false;
m_compiler->getLangOpts().AccessControl = false; // Debuggers get universal access
m_compiler->getLangOpts().DollarIdents = true; // $ indicates a persistent variable name
// Set CodeGen options
m_compiler->getCodeGenOpts().EmitDeclMetadata = true;
m_compiler->getCodeGenOpts().InstrumentFunctions = false;
// Disable some warnings.
m_compiler->getDiagnosticOpts().Warnings.push_back("no-unused-value");
// Set the target triple.
Target *target = NULL;
if (exe_scope)
target = exe_scope->CalculateTarget();
// TODO: figure out what to really do when we don't have a valid target.
// Sometimes this will be ok to just use the host target triple (when we
// evaluate say "2+3", but other expressions like breakpoint conditions
// and other things that _are_ target specific really shouldn't just be
// using the host triple. This needs to be fixed in a better way.
if (target && target->GetArchitecture().IsValid())
m_compiler->getTargetOpts().Triple = target->GetArchitecture().GetTriple().str();
else
m_compiler->getTargetOpts().Triple = llvm::sys::getHostTriple();
// 3. Set up various important bits of infrastructure.
m_compiler->createDiagnostics(0, 0);
// Create the target instance.
m_compiler->setTarget(TargetInfo::CreateTargetInfo(m_compiler->getDiagnostics(),
m_compiler->getTargetOpts()));
assert (m_compiler->hasTarget());
// Inform the target of the language options
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
m_compiler->getTarget().setForcedLangOptions(m_compiler->getLangOpts());
// 4. Set up the diagnostic buffer for reporting errors
m_compiler->getDiagnostics().setClient(new clang::TextDiagnosticBuffer);
// 5. Set up the source management objects inside the compiler
clang::FileSystemOptions file_system_options;
m_file_manager.reset(new clang::FileManager(file_system_options));
if (!m_compiler->hasSourceManager())
m_compiler->createSourceManager(*m_file_manager.get());
m_compiler->createFileManager();
//.........这里部分代码省略.........