mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Deduplicate code for printing source locations
This commit is contained in:
@@ -22,9 +22,13 @@
|
||||
|
||||
#include <libsolutil/CommonIO.h>
|
||||
|
||||
#include <libyul/AsmPrinter.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::langutil;
|
||||
using namespace solidity::frontend;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::yul;
|
||||
|
||||
namespace solidity::frontend
|
||||
{
|
||||
@@ -131,12 +135,11 @@ string dispenseLocationComment(langutil::SourceLocation const& _location, IRGene
|
||||
{
|
||||
solAssert(_location.sourceName, "");
|
||||
_context.markSourceUsed(*_location.sourceName);
|
||||
return "/// @src "
|
||||
+ to_string(_context.sourceIndices().at(*_location.sourceName))
|
||||
+ ":"
|
||||
+ to_string(_location.start)
|
||||
+ ":"
|
||||
+ to_string(_location.end);
|
||||
return AsmPrinter::formatSourceLocationComment(
|
||||
_location,
|
||||
_context.sourceIndices(),
|
||||
true /* _statement */
|
||||
);
|
||||
}
|
||||
|
||||
string dispenseLocationComment(ASTNode const& _node, IRGenerationContext& _context)
|
||||
|
||||
Reference in New Issue
Block a user