Skip to content

Commit b2eb2d2

Browse files
committed
Add unsafe constants getter to CompilerContext
1 parent 4d3f979 commit b2eb2d2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎include/scratchcpp/compilercontext.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class LIBSCRATCHCPP_EXPORT CompilerContext
2525
IEngine *engine() const;
2626
Target *target() const;
2727

28+
const std::unordered_set<std::string> &unsafeConstants() const;
29+
2830
/*!
2931
* Optimizes compiled scripts ahead of time.
3032
* \see Compiler#preoptimize()

‎src/engine/compilercontext.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ Target *CompilerContext::target() const
2323
{
2424
return impl->target;
2525
}
26+
27+
/*! Returns the list of unsafe constants (used internally during optimization). */
28+
const std::unordered_set<std::string> &CompilerContext::unsafeConstants() const
29+
{
30+
return impl->unsafeConstants;
31+
}

0 commit comments

Comments
 (0)