summaryrefslogtreecommitdiffstats
path: root/source/slang-record-replay/record/slang-entrypoint.cpp
blob: 3eb9bca77b04c8795ce3a24a53ca2d446f2bb1fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "slang-entrypoint.h"

#include "../util/record-utility.h"

namespace SlangRecord
{
EntryPointRecorder::EntryPointRecorder(
    SessionRecorder* sessionRecorder,
    slang::IEntryPoint* entryPoint,
    RecordManager* recordManager)
    : IComponentTypeRecorder(entryPoint, recordManager)
    , m_sessionRecorder(sessionRecorder)
    , m_actualEntryPoint(entryPoint)
{
    SLANG_RECORD_ASSERT(m_actualEntryPoint != nullptr);
    slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, entryPoint);
}

ISlangUnknown* EntryPointRecorder::getInterface(const Guid& guid)
{
    if (guid == IEntryPointRecorder::getTypeGuid())
    {
        return static_cast<IEntryPointRecorder*>(this);
    }
    else
        return nullptr;
}

SLANG_NO_THROW slang::FunctionReflection* EntryPointRecorder::getFunctionReflection()
{
    return m_actualEntryPoint->getFunctionReflection();
}

} // namespace SlangRecord