Coverage Report

Created: 2023-09-30 09:22

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- ClangExpressionVariable.cpp ---------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "ClangExpressionVariable.h"
10
11
#include "lldb/Core/Value.h"
12
#include "lldb/Core/ValueObjectConstResult.h"
13
#include "lldb/Target/ExecutionContext.h"
14
#include "lldb/Target/Process.h"
15
#include "lldb/Utility/ConstString.h"
16
#include "lldb/Utility/DataExtractor.h"
17
#include "lldb/Utility/Stream.h"
18
#include "clang/AST/ASTContext.h"
19
20
using namespace lldb_private;
21
using namespace clang;
22
23
char ClangExpressionVariable::ID;
24
25
ClangExpressionVariable::ClangExpressionVariable(
26
    ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,
27
    uint32_t addr_byte_size)
28
281
    : m_parser_vars(), m_jit_vars() {
29
281
  m_flags = EVNone;
30
281
  m_frozen_sp =
31
281
      ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
32
281
}
33
34
ClangExpressionVariable::ClangExpressionVariable(
35
    ExecutionContextScope *exe_scope, Value &value, ConstString name,
36
    uint16_t flags)
37
0
    : m_parser_vars(), m_jit_vars() {
38
0
  m_flags = flags;
39
0
  m_frozen_sp = ValueObjectConstResult::Create(exe_scope, value, name);
40
0
}
41
42
ClangExpressionVariable::ClangExpressionVariable(
43
    const lldb::ValueObjectSP &valobj_sp)
44
13.8k
    : m_parser_vars(), m_jit_vars() {
45
13.8k
  m_flags = EVNone;
46
13.8k
  m_frozen_sp = valobj_sp;
47
13.8k
}
48
49
ClangExpressionVariable::ClangExpressionVariable(
50
    ExecutionContextScope *exe_scope, ConstString name,
51
    const TypeFromUser &user_type, lldb::ByteOrder byte_order,
52
    uint32_t addr_byte_size)
53
13.7k
    : m_parser_vars(), m_jit_vars() {
54
13.7k
  m_flags = EVNone;
55
13.7k
  m_frozen_sp =
56
13.7k
      ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
57
13.7k
  SetName(name);
58
13.7k
  SetCompilerType(user_type);
59
13.7k
}
60
61
139
TypeFromUser ClangExpressionVariable::GetTypeFromUser() {
62
139
  TypeFromUser tfu(m_frozen_sp->GetCompilerType());
63
139
  return tfu;
64
139
}