diff options
author | Sean Callanan <scallanan@apple.com> | 2013-06-27 18:08:02 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-06-27 18:08:02 +0000 |
commit | 7dcbe3d356d748ba49a1b00ca0a300a37d571978 (patch) | |
tree | ac168dcc8378345f744adafc6b7a7dc9bcec89e2 /lldb | |
parent | f183082dc6c92c3f751561ba29cddbbf22dbc76b (diff) | |
download | bcm5719-llvm-7dcbe3d356d748ba49a1b00ca0a300a37d571978.tar.gz bcm5719-llvm-7dcbe3d356d748ba49a1b00ca0a300a37d571978.zip |
Cleanup of IRForTarget. Removed some relics of
the time when the IRInterpreter ran inside
IRForTarget.
llvm-svn: 185088
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Expression/IRForTarget.h | 4 | ||||
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 80 |
2 files changed, 1 insertions, 83 deletions
diff --git a/lldb/include/lldb/Expression/IRForTarget.h b/lldb/include/lldb/Expression/IRForTarget.h index 8134909a98a..a182069b038 100644 --- a/lldb/include/lldb/Expression/IRForTarget.h +++ b/lldb/include/lldb/Expression/IRForTarget.h @@ -654,15 +654,13 @@ private: lldb_private::ConstString m_result_name; ///< The name of the result variable ($0, $1, ...) lldb_private::TypeFromParser m_result_type; ///< The type of the result variable. llvm::Module *m_module; ///< The module being processed, or NULL if that has not been determined yet. - std::unique_ptr<llvm::DataLayout> m_target_data; ///< The target data for the module being processed, or NULL if there is no module. + std::unique_ptr<llvm::DataLayout> m_target_data; ///< The target data for the module being processed, or NULL if there is no module. lldb_private::ClangExpressionDeclMap *m_decl_map; ///< The DeclMap containing the Decls StaticDataAllocator m_data_allocator; ///< The allocator to use for constant strings - lldb_private::IRMemoryMap &m_memory_map; ///< The memory map to pass to the IR interpreter llvm::Constant *m_CFStringCreateWithBytes; ///< The address of the function CFStringCreateWithBytes, cast to the appropriate function pointer type llvm::Constant *m_sel_registerName; ///< The address of the function sel_registerName, cast to the appropriate function pointer type lldb_private::Stream *m_error_stream; ///< If non-NULL, the stream on which errors should be printed - bool m_has_side_effects; ///< True if the function's result cannot be simply determined statically llvm::StoreInst *m_result_store; ///< If non-NULL, the store instruction that writes to the result variable. If m_has_side_effects is true, this is NULL. bool m_result_is_pointer; ///< True if the function's result in the AST is a pointer (see comments in ASTResultSynthesizer::SynthesizeBodyResult) diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 68be33a06bd..232e77c2062 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -73,11 +73,9 @@ IRForTarget::IRForTarget (lldb_private::ClangExpressionDeclMap *decl_map, m_module(NULL), m_decl_map(decl_map), m_data_allocator(execution_unit), - m_memory_map(execution_unit), m_CFStringCreateWithBytes(NULL), m_sel_registerName(NULL), m_error_stream(error_stream), - m_has_side_effects(false), m_result_store(NULL), m_result_is_pointer(false), m_reloc_placeholder(NULL) @@ -128,67 +126,6 @@ IRForTarget::FixFunctionLinkage(llvm::Function &llvm_function) } bool -IRForTarget::HasSideEffects (llvm::Function &llvm_function) -{ - llvm::Function::iterator bbi; - BasicBlock::iterator ii; - - for (bbi = llvm_function.begin(); - bbi != llvm_function.end(); - ++bbi) - { - BasicBlock &basic_block = *bbi; - - for (ii = basic_block.begin(); - ii != basic_block.end(); - ++ii) - { - switch (ii->getOpcode()) - { - default: - return true; - case Instruction::Store: - { - StoreInst *store_inst = dyn_cast<StoreInst>(ii); - - Value *store_ptr = store_inst->getPointerOperand(); - - std::string ptr_name; - - if (store_ptr->hasName()) - ptr_name = store_ptr->getName().str(); - - if (isa <AllocaInst> (store_ptr)) - break; - - if (ptr_name.find("$__lldb_expr_result") != std::string::npos) - { - if (ptr_name.find("GV") == std::string::npos) - m_result_store = store_inst; - } - else - { - return true; - } - - break; - } - case Instruction::Load: - case Instruction::Alloca: - case Instruction::GetElementPtr: - case Instruction::BitCast: - case Instruction::Ret: - case Instruction::ICmp: - case Instruction::Br: - break; - } - } - } - - return false; -} - -bool IRForTarget::GetFunctionAddress (llvm::Function *fun, uint64_t &fun_addr, lldb_private::ConstString &name, @@ -687,16 +624,6 @@ IRForTarget::CreateResultVariable (llvm::Function &llvm_function) Constant *initializer = result_global->getInitializer(); - // Here we write the initializer into a result variable assuming it - // can be computed statically. - - if (!m_has_side_effects) - { - //MaybeSetConstantResult (initializer, - // m_result_name, - // m_result_type); - } - StoreInst *synthesized_store = new StoreInst(initializer, new_result_global, first_entry_instruction); @@ -706,11 +633,6 @@ IRForTarget::CreateResultVariable (llvm::Function &llvm_function) } else { - if (!m_has_side_effects && lldb_private::ClangASTContext::IsPointerType (m_result_type.GetOpaqueQualType())) - { - //MaybeSetCastResult (m_result_type); - } - result_global->replaceAllUsesWith(new_result_global); } @@ -2669,8 +2591,6 @@ IRForTarget::runOnModule (Module &llvm_module) Function::iterator bbi; - m_has_side_effects = HasSideEffects(*function); - //////////////////////////////////////////////////////////// // Replace $__lldb_expr_result with a persistent variable // |