1*dda28197Spatrick //===-- Expression.cpp ----------------------------------------------------===// 2061da546Spatrick // 3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information. 5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6061da546Spatrick // 7061da546Spatrick //===----------------------------------------------------------------------===// 8061da546Spatrick 9061da546Spatrick #include "lldb/Expression/Expression.h" 10061da546Spatrick #include "lldb/Target/ExecutionContextScope.h" 11061da546Spatrick #include "lldb/Target/Target.h" 12061da546Spatrick 13061da546Spatrick using namespace lldb_private; 14061da546Spatrick Expression(Target & target)15061da546SpatrickExpression::Expression(Target &target) 16061da546Spatrick : m_target_wp(target.shared_from_this()), 17061da546Spatrick m_jit_start_addr(LLDB_INVALID_ADDRESS), 18061da546Spatrick m_jit_end_addr(LLDB_INVALID_ADDRESS) { 19061da546Spatrick // Can't make any kind of expression without a target. 20061da546Spatrick assert(m_target_wp.lock()); 21061da546Spatrick } 22061da546Spatrick Expression(ExecutionContextScope & exe_scope)23061da546SpatrickExpression::Expression(ExecutionContextScope &exe_scope) 24061da546Spatrick : m_target_wp(exe_scope.CalculateTarget()), 25061da546Spatrick m_jit_start_addr(LLDB_INVALID_ADDRESS), 26061da546Spatrick m_jit_end_addr(LLDB_INVALID_ADDRESS) { 27061da546Spatrick assert(m_target_wp.lock()); 28061da546Spatrick } 29