summaryrefslogtreecommitdiffstats
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Sehr <sehr@google.com>2018-03-02 12:01:51 -0800
committerDavid Sehr <sehr@google.com>2018-03-05 13:58:20 -0800
commitc431b9dc4b23cc950eb313695258df5d89f53b22 (patch)
tree422273559c3ae52caff0c6b1cf1a62a8312f0e26 /cmdline
parentf46f46cf5bd32788d5252b7107628a66594a5e98 (diff)
downloadart-c431b9dc4b23cc950eb313695258df5d89f53b22.tar.gz
art-c431b9dc4b23cc950eb313695258df5d89f53b22.tar.bz2
art-c431b9dc4b23cc950eb313695258df5d89f53b22.zip
Move most of runtime/base to libartbase/base
Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline.h2
-rw-r--r--cmdline/cmdline_parser_test.cc4
-rw-r--r--cmdline/cmdline_result.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/cmdline/cmdline.h b/cmdline/cmdline.h
index 60dfdce03b..95ab12324c 100644
--- a/cmdline/cmdline.h
+++ b/cmdline/cmdline.h
@@ -28,6 +28,7 @@
#include "base/file_utils.h"
#include "base/logging.h"
+#include "base/mutex.h"
#include "base/stringpiece.h"
#include "noop_compiler_callbacks.h"
#include "runtime.h"
@@ -303,6 +304,7 @@ struct CmdlineArgs {
template <typename Args = CmdlineArgs>
struct CmdlineMain {
int Main(int argc, char** argv) {
+ Locks::Init();
InitLogging(argv, Runtime::Abort);
std::unique_ptr<Args> args = std::unique_ptr<Args>(CreateArguments());
args_ = args.get();
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index 3cb9731a17..235a2aa90e 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -20,12 +20,13 @@
#include "gtest/gtest.h"
+#include "base/mutex.h"
+#include "base/utils.h"
#include "jdwp_provider.h"
#include "experimental_flags.h"
#include "parsed_options.h"
#include "runtime.h"
#include "runtime_options.h"
-#include "utils.h"
#define EXPECT_NULL(expected) EXPECT_EQ(reinterpret_cast<const void*>(expected), \
reinterpret_cast<void*>(nullptr));
@@ -126,6 +127,7 @@ class CmdlineParserTest : public ::testing::Test {
using RuntimeParser = ParsedOptions::RuntimeParser;
static void SetUpTestCase() {
+ art::Locks::Init();
art::InitLogging(nullptr, art::Runtime::Abort); // argv = null
}
diff --git a/cmdline/cmdline_result.h b/cmdline/cmdline_result.h
index e41043abf0..0ae1145a52 100644
--- a/cmdline/cmdline_result.h
+++ b/cmdline/cmdline_result.h
@@ -18,7 +18,7 @@
#define ART_CMDLINE_CMDLINE_RESULT_H_
#include <assert.h>
-#include <utils.h>
+#include "base/utils.h"
namespace art {
// Result of an attempt to process the command line arguments. If fails, specifies