Alexander Shaposhnikov | 696bd63 | 2016-11-26 05:23:44 +0000 | [diff] [blame] | 1 | //===-- Expression.cpp ------------------------------------------*- C++ -*-===// |
Jim Ingham | 151c032 | 2015-09-15 21:13:50 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "lldb/Expression/Expression.h" |
| 11 | #include "lldb/Target/ExecutionContextScope.h" |
| 12 | #include "lldb/Target/Target.h" |
| 13 | |
| 14 | using namespace lldb_private; |
| 15 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 16 | Expression::Expression(Target &target) |
| 17 | : m_target_wp(target.shared_from_this()), |
| 18 | m_jit_start_addr(LLDB_INVALID_ADDRESS), |
| 19 | m_jit_end_addr(LLDB_INVALID_ADDRESS) { |
| 20 | // Can't make any kind of expression without a target. |
| 21 | assert(m_target_wp.lock()); |
Jim Ingham | 151c032 | 2015-09-15 21:13:50 +0000 | [diff] [blame] | 22 | } |
| 23 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 24 | Expression::Expression(ExecutionContextScope &exe_scope) |
| 25 | : m_target_wp(exe_scope.CalculateTarget()), |
| 26 | m_jit_start_addr(LLDB_INVALID_ADDRESS), |
| 27 | m_jit_end_addr(LLDB_INVALID_ADDRESS) { |
| 28 | assert(m_target_wp.lock()); |
Jim Ingham | 151c032 | 2015-09-15 21:13:50 +0000 | [diff] [blame] | 29 | } |