Remove log.h from solidity.

This commit is contained in:
chriseth 2016-04-12 00:54:14 +02:00
parent 193b1c940c
commit 6f54b13d7a
12 changed files with 1 additions and 19 deletions

View File

@ -21,7 +21,6 @@
#include "Assembly.h" #include "Assembly.h"
#include <fstream> #include <fstream>
#include <libdevcore/Log.h>
#include <libevmasm/CommonSubexpressionEliminator.h> #include <libevmasm/CommonSubexpressionEliminator.h>
#include <libevmasm/ControlFlowGraph.h> #include <libevmasm/ControlFlowGraph.h>
#include <libevmasm/BlockDeduplicator.h> #include <libevmasm/BlockDeduplicator.h>
@ -307,9 +306,6 @@ void Assembly::injectStart(AssemblyItem const& _i)
m_items.insert(m_items.begin(), _i); m_items.insert(m_items.begin(), _i);
} }
struct OptimiserChannel: public LogChannel { static const char* name() { return "OPT"; } static const int verbosity = 12; };
#define copt dev::LogOutputStream<OptimiserChannel, true>()
Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs) Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
{ {
if (!_enable) if (!_enable)
@ -318,10 +314,8 @@ Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
unsigned total = 0; unsigned total = 0;
for (unsigned count = 1; count > 0; total += count) for (unsigned count = 1; count > 0; total += count)
{ {
copt << toString(*this);
count = 0; count = 0;
copt << "Performing optimisation...";
// This only modifies PushTags, we have to run again to actually remove code. // This only modifies PushTags, we have to run again to actually remove code.
BlockDeduplicator dedup(m_items); BlockDeduplicator dedup(m_items);
if (dedup.deduplicate()) if (dedup.deduplicate())
@ -360,7 +354,6 @@ Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
if (shouldReplace) if (shouldReplace)
{ {
copt << "Old size: " << (iter - orig) << ", new size: " << optimisedChunk.size();
count++; count++;
optimisedItems += optimisedChunk; optimisedItems += optimisedChunk;
} }
@ -384,8 +377,6 @@ Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs)
m_items m_items
); );
copt << total << " optimisations done.";
for (auto& sub: m_subs) for (auto& sub: m_subs)
sub.optimise(true, false, _runs); sub.optimise(true, false, _runs);

View File

@ -24,7 +24,6 @@
#include <functional> #include <functional>
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/CommonIO.h> #include <libdevcore/CommonIO.h>
#include <libdevcore/Log.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::solidity; using namespace dev::solidity;

View File

@ -28,7 +28,6 @@
#include <boost/spirit/include/support_utree.hpp> #include <boost/spirit/include/support_utree.hpp>
#pragma warning(pop) #pragma warning(pop)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#include <libdevcore/Log.h>
#include <libdevcore/CommonIO.h> #include <libdevcore/CommonIO.h>
#include <libevmasm/Instruction.h> #include <libevmasm/Instruction.h>
#include "CompilerState.h" #include "CompilerState.h"

View File

@ -27,6 +27,7 @@
#include <map> #include <map>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/CommonIO.h>
#include <libsolidity/interface/Exceptions.h> #include <libsolidity/interface/Exceptions.h>
#include <libsolidity/ast/ASTForward.h> #include <libsolidity/ast/ASTForward.h>
#include <libsolidity/parsing/Token.h> #include <libsolidity/parsing/Token.h>

View File

@ -22,7 +22,6 @@
#include <ctype.h> #include <ctype.h>
#include <vector> #include <vector>
#include <libdevcore/Log.h>
#include <libevmasm/SourceLocation.h> #include <libevmasm/SourceLocation.h>
#include <libsolidity/parsing/Parser.h> #include <libsolidity/parsing/Parser.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>

View File

@ -53,7 +53,6 @@
#pragma once #pragma once
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/Log.h>
#include <libdevcore/CommonData.h> #include <libdevcore/CommonData.h>
#include <libevmasm/SourceLocation.h> #include <libevmasm/SourceLocation.h>
#include <libsolidity/parsing/Token.h> #include <libsolidity/parsing/Token.h>

View File

@ -43,7 +43,6 @@
#pragma once #pragma once
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/Log.h>
#include <libsolidity/interface/Utils.h> #include <libsolidity/interface/Utils.h>
#include <libsolidity/interface/Exceptions.h> #include <libsolidity/interface/Exceptions.h>
#include <libdevcore/UndefMacros.h> #include <libdevcore/UndefMacros.h>

View File

@ -23,7 +23,6 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <libdevcore/Log.h>
#include <libevmasm/SourceLocation.h> #include <libevmasm/SourceLocation.h>
#include <libevmasm/Assembly.h> #include <libevmasm/Assembly.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>

View File

@ -22,7 +22,6 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <libdevcore/Log.h>
#include <libevmasm/Assembly.h> #include <libevmasm/Assembly.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
#include <libsolidity/inlineasm/AsmStack.h> #include <libsolidity/inlineasm/AsmStack.h>

View File

@ -22,7 +22,6 @@
#include <string> #include <string>
#include <libdevcore/Log.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h> #include <libsolidity/parsing/Parser.h>
#include <libsolidity/analysis/NameAndTypeResolver.h> #include <libsolidity/analysis/NameAndTypeResolver.h>

View File

@ -22,7 +22,6 @@
#include <string> #include <string>
#include <libdevcore/Log.h>
#include <libdevcore/SHA3.h> #include <libdevcore/SHA3.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h> #include <libsolidity/parsing/Parser.h>

View File

@ -22,7 +22,6 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <libdevcore/Log.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h> #include <libsolidity/parsing/Parser.h>
#include <libsolidity/interface/Exceptions.h> #include <libsolidity/interface/Exceptions.h>