mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not set source locations for small internal assembly routines.
This commit is contained in:
+15
-2
@@ -46,8 +46,15 @@ public:
|
||||
None, ForLoopPre, ForLoopPost, ForLoopBody
|
||||
};
|
||||
|
||||
explicit Parser(langutil::ErrorReporter& _errorReporter, Dialect const& _dialect):
|
||||
ParserBase(_errorReporter), m_dialect(_dialect) {}
|
||||
explicit Parser(
|
||||
langutil::ErrorReporter& _errorReporter,
|
||||
Dialect const& _dialect,
|
||||
std::optional<langutil::SourceLocation> _locationOverride = {}
|
||||
):
|
||||
ParserBase(_errorReporter),
|
||||
m_dialect(_dialect),
|
||||
m_locationOverride(std::move(_locationOverride))
|
||||
{}
|
||||
|
||||
/// Parses an inline assembly block starting with `{` and ending with `}`.
|
||||
/// @param _reuseScanner if true, do check for end of input after the `}`.
|
||||
@@ -60,6 +67,11 @@ public:
|
||||
protected:
|
||||
using ElementaryOperation = std::variant<Literal, Identifier, FunctionCall>;
|
||||
|
||||
langutil::SourceLocation currentLocation() const override
|
||||
{
|
||||
return m_locationOverride ? *m_locationOverride : ParserBase::currentLocation();
|
||||
}
|
||||
|
||||
/// Creates an inline assembly node with the current source location.
|
||||
template <class T> T createWithLocation() const
|
||||
{
|
||||
@@ -91,6 +103,7 @@ protected:
|
||||
|
||||
private:
|
||||
Dialect const& m_dialect;
|
||||
std::optional<langutil::SourceLocation> m_locationOverride;
|
||||
ForLoopComponent m_currentForLoopComponent = ForLoopComponent::None;
|
||||
bool m_insideFunction = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user