mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
Updated LLVM to take a new MC JIT that supports
allocations by section. We install these sections in the target process and inform the JIT of their new locations. Also removed some unused variable warnings. llvm-svn: 151789
This commit is contained in:
@@ -327,6 +327,16 @@ public:
|
||||
bool
|
||||
CommitAllocations (Process &process);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// [Convenience method for ClangExpressionParser] Report all committed
|
||||
/// allocations to the execution engine.
|
||||
///
|
||||
/// @param[in] engine
|
||||
/// The execution engine to notify.
|
||||
//------------------------------------------------------------------
|
||||
void
|
||||
ReportAllocations (llvm::ExecutionEngine &engine);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// [Convenience method for ClangExpressionParser] Write the contents
|
||||
/// of all allocations to the process.
|
||||
|
||||
@@ -21,8 +21,8 @@ our ($llvm_clang_basename, $llvm_clang_dirname) = fileparse ($llvm_clang_outfile
|
||||
|
||||
our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
|
||||
|
||||
our $llvm_revision = "151267";
|
||||
our $clang_revision = "151267";
|
||||
our $llvm_revision = "151777";
|
||||
our $clang_revision = "151777";
|
||||
|
||||
our $SRCROOT = "$ENV{SRCROOT}";
|
||||
our $llvm_dstroot_zip = "$SRCROOT/llvm.zip";
|
||||
|
||||
@@ -36,8 +36,7 @@ StreamString &
|
||||
StreamCallback::FindStreamForThread(lldb::tid_t cur_tid)
|
||||
{
|
||||
Mutex::Locker (m_collection_mutex);
|
||||
collection::iterator iter, end_iter = m_accumulated_data.end();
|
||||
iter = m_accumulated_data.find (cur_tid);
|
||||
collection::iterator iter = m_accumulated_data.find (cur_tid);
|
||||
if (iter == m_accumulated_data.end())
|
||||
{
|
||||
std::pair<collection::iterator, bool> ret;
|
||||
|
||||
@@ -363,7 +363,7 @@ ClangExpressionParser::Parse (Stream &stream)
|
||||
diag_buf->FlushDiagnostics (m_compiler->getDiagnostics());
|
||||
|
||||
MemoryBuffer *memory_buffer = MemoryBuffer::getMemBufferCopy(m_expr.Text(), __FUNCTION__);
|
||||
FileID memory_buffer_file_id = m_compiler->getSourceManager().createMainFileIDForMemBuffer (memory_buffer);
|
||||
m_compiler->getSourceManager().createMainFileIDForMemBuffer (memory_buffer);
|
||||
|
||||
diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor());
|
||||
|
||||
@@ -626,6 +626,7 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr,
|
||||
}
|
||||
|
||||
jit_memory_manager->CommitAllocations(*process);
|
||||
jit_memory_manager->ReportAllocations(*execution_engine);
|
||||
jit_memory_manager->WriteData(*process);
|
||||
|
||||
std::vector<JittedFunction>::iterator pos, end = m_jitted_functions.end();
|
||||
|
||||
@@ -156,17 +156,6 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err)
|
||||
|
||||
m_cplusplus = true;
|
||||
m_needs_object_ptr = true;
|
||||
|
||||
do {
|
||||
clang::QualType this_type = method_decl->getThisType(decl_context->getParentASTContext());
|
||||
|
||||
const clang::PointerType *this_pointer_type = this_type->getAs<clang::PointerType>();
|
||||
|
||||
if (!this_pointer_type)
|
||||
break;
|
||||
|
||||
clang::QualType this_pointee_type = this_pointer_type->getPointeeType();
|
||||
} while (0);
|
||||
}
|
||||
}
|
||||
else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_context))
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
// C Includes
|
||||
// C++ Includes
|
||||
// Other libraries and framework includes
|
||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||
// Project includes
|
||||
#include "lldb/Expression/RecordingMemoryManager.h"
|
||||
|
||||
@@ -276,6 +277,20 @@ RecordingMemoryManager::CommitAllocations (Process &process)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
RecordingMemoryManager::ReportAllocations (llvm::ExecutionEngine &engine)
|
||||
{
|
||||
for (AllocationList::iterator ai = m_allocations.begin(), ae = m_allocations.end();
|
||||
ai != ae;
|
||||
++ai)
|
||||
{
|
||||
if (!ai->m_allocated)
|
||||
continue;
|
||||
|
||||
engine.mapSectionAddress((void*)ai->m_local_start, ai->m_remote_start);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
RecordingMemoryManager::WriteData (Process &process)
|
||||
{
|
||||
|
||||
@@ -2284,6 +2284,7 @@ ClangASTContext::AddObjCClassProperty
|
||||
SourceLocation(), // Source Location
|
||||
&identifier_table->get(property_name),
|
||||
SourceLocation(), //Source Location for AT
|
||||
SourceLocation(), //Source location for (
|
||||
prop_type_source
|
||||
);
|
||||
if (property_decl)
|
||||
|
||||
@@ -1135,7 +1135,6 @@ ClangASTType::DumpSummary
|
||||
)
|
||||
{
|
||||
uint32_t length = 0;
|
||||
clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type));
|
||||
if (ClangASTContext::IsCStringType (clang_type, length))
|
||||
{
|
||||
if (exe_ctx)
|
||||
|
||||
Reference in New Issue
Block a user