• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "gn/item.h"
6 
7 #include "base/logging.h"
8 #include "gn/settings.h"
9 
Item(const Settings * settings,const Label & label,const SourceFileSet & build_dependency_files)10 Item::Item(const Settings* settings,
11            const Label& label,
12            const SourceFileSet& build_dependency_files)
13     : settings_(settings),
14       label_(label),
15       build_dependency_files_(build_dependency_files),
16       defined_from_(nullptr) {}
17 
18 Item::~Item() = default;
19 
AsConfig()20 Config* Item::AsConfig() {
21   return nullptr;
22 }
AsConfig() const23 const Config* Item::AsConfig() const {
24   return nullptr;
25 }
AsPool()26 Pool* Item::AsPool() {
27   return nullptr;
28 }
AsPool() const29 const Pool* Item::AsPool() const {
30   return nullptr;
31 }
AsTarget()32 Target* Item::AsTarget() {
33   return nullptr;
34 }
AsTarget() const35 const Target* Item::AsTarget() const {
36   return nullptr;
37 }
AsToolchain()38 Toolchain* Item::AsToolchain() {
39   return nullptr;
40 }
AsToolchain() const41 const Toolchain* Item::AsToolchain() const {
42   return nullptr;
43 }
44 
GetItemTypeName() const45 std::string Item::GetItemTypeName() const {
46   if (AsConfig())
47     return "config";
48   if (AsTarget())
49     return "target";
50   if (AsToolchain())
51     return "toolchain";
52   if (AsPool())
53     return "pool";
54   NOTREACHED();
55   return "this thing that I have no idea what it is";
56 }
57 
OnResolved(Err * err)58 bool Item::OnResolved(Err* err) {
59   return true;
60 }
61