]> git.tdb.fi Git - builder.git/commitdiff
Remove most container typedefs and refactor others
authorMikko Rasa <tdb@tdb.fi>
Mon, 19 Dec 2022 17:18:11 +0000 (19:18 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 19 Dec 2022 17:40:25 +0000 (19:40 +0200)
29 files changed:
source/analyzer.h
source/architecture.h
source/binarycomponent.cpp
source/binarycomponent.h
source/binarypackage.cpp
source/binarypackage.h
source/builder.h
source/buildercli.cpp
source/buildercli.h
source/buildgraph.h
source/buildinfo.h
source/cache.cpp
source/cache.h
source/component.cpp
source/component.h
source/config.h
source/csourcefile.cpp
source/csourcefile.h
source/datapack.h
source/externaltask.h
source/gnulinker.cpp
source/package.h
source/packagemanager.h
source/sourcepackage.h
source/target.h
source/tool.h
source/toolchain.h
source/virtualfilesystem.cpp
source/virtualfilesystem.h

index 5464dacf989ac84ecea5be2a0c9353128924ec8f..373150b847690039a77e402a737e5d57c8bdef9f 100644 (file)
@@ -25,12 +25,11 @@ public:
        };
 
 private:
-       typedef std::vector<std::string> TableRow;
-       typedef std::list<TableRow> Table;
+       using TableRow = std::vector<std::string>;
 
        Builder &builder;
        Mode mode;
-       Table table;
+       std::list<TableRow> table;
        unsigned max_depth;
        bool full_paths;
        std::map<const Target *, std::set<Target *> > rdepends;
index 5b894b1ee740d14f891b73d8ffee55701407d709..7f3c4b2a45e28b4e1d3c8900fa5e23cbb2d00bf2 100644 (file)
@@ -21,8 +21,6 @@ public:
                Loader(Architecture &);
        };
 
-       typedef std::list<Pattern> PatternList;
-
 private:
        Builder &builder;
        std::string type;
@@ -34,7 +32,7 @@ private:
        std::string name;
        bool native;
        std::string cross_prefix;
-       std::map<std::string, PatternList> filename_patterns;
+       std::map<std::string, std::list<Pattern>> filename_patterns;
 
 public:
        Architecture(Builder &b, const std::string &spec);
@@ -54,7 +52,7 @@ public:
        const std::string &get_cross_prefix() const { return cross_prefix; }
 
        template<typename T>
-       const PatternList &get_patterns() const;
+       const std::list<Pattern> &get_patterns() const;
 
        template<typename T>
        std::string create_filename(const std::string &) const;
@@ -69,20 +67,20 @@ private:
 };
 
 template<typename T>
-inline const Architecture::PatternList &Architecture::get_patterns() const
+inline const std::list<Pattern> &Architecture::get_patterns() const
 {
        auto i = filename_patterns.find(typeid(T).name());
        if(i!=filename_patterns.end())
                return i->second;
 
-       static PatternList empty;
+       static std::list<Pattern> empty;
        return empty;
 }
 
 template<typename T>
 inline std::string Architecture::create_filename(const std::string &base) const
 {
-       const PatternList &patterns = get_patterns<T>();
+       const std::list<Pattern> &patterns = get_patterns<T>();
        return patterns.empty() ? base : patterns.front().apply(base);
 }
 
index 816b38573e79bfb4970808b438c8ff67458d0132..f1aaa0eb006b22a5366a1b5bc12766e08806b45e 100644 (file)
@@ -54,7 +54,7 @@ void BinaryComponent::create_targets() const
        const Toolchain &pkg_tools = package.get_toolchain();
 
        list<Target *> objs;
-       SourceList source_filenames = collect_source_files();
+       list<FS::Path> source_filenames = collect_source_files();
        for(auto i=source_filenames.begin(); i!=source_filenames.end(); ++i)
        {
                string ext = FS::extpart(FS::basename(*i));
index 7c8453420b2cd1cbef60f9cf53829507898e577a..c31fff2582eff09ee327ad4021fd3c49b97cea7e 100644 (file)
@@ -22,10 +22,8 @@ public:
        };
 
 private:
-       typedef std::list<const Component *> UseList;
-
        Type type;
-       UseList uses;
+       std::list<const Component *> uses;
 
 public:
        BinaryComponent(SourcePackage &, const std::string &, Type);
index 02b9be21d7b58966a323ea66f295af14f0158d7f..c0d688afdbb45532f7368d0d2bbb8065ac34301e 100644 (file)
@@ -83,7 +83,7 @@ void BinaryPackage::do_prepare()
                                prefix /= arch.get_cross_prefix();
                }
 
-               BuildInfo::PathList libpath = export_binfo.libpath;
+               VirtualFileSystem::SearchPath libpath = export_binfo.libpath;
                if(!system && libpath.empty())
                        libpath.push_back("lib");
                for(FS::Path &p: libpath)
@@ -93,7 +93,7 @@ void BinaryPackage::do_prepare()
                for(const string &l: export_binfo.libs)
                        all_found &= (builder.get_vfs().find_library(l, libpath, export_binfo.libmode, system)!=0);
 
-               BuildInfo::PathList incpath = export_binfo.incpath;
+               VirtualFileSystem::SearchPath incpath = export_binfo.incpath;
                if(!system && incpath.empty())
                        incpath.push_back("include");
                for(FS::Path &p: incpath)
@@ -135,7 +135,7 @@ void BinaryPackage::do_prepare()
 
        if(!static_binfo.libs.empty())
        {
-               BuildInfo::PathList combined_libpath = static_binfo.libpath;
+               VirtualFileSystem::SearchPath combined_libpath = static_binfo.libpath;
                combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end());
 
                for(const string &l: export_binfo.libs)
index f015ee55de9dbcf76386bfaa3b7aa9737d7dadc5..b96015589e04ea45c164ecbb92fae08fc8c109e4 100644 (file)
@@ -19,13 +19,11 @@ public:
                void header(const std::string &);
        };
 
-       typedef std::vector<std::string> Flags;
+       using Flags = std::vector<std::string>;
 
 private:
-       typedef std::list<std::string> HeaderList;
-
        Msp::FS::Path base_path;
-       HeaderList headers;
+       std::list<std::string> headers;
        BuildInfo static_binfo;
 
 public:
index 70ca861bc64cefb22c13c7d91c98eacfbef61a15..e6eb0ea5c2843b3b813dbcc497a7379dfa40b71d 100644 (file)
@@ -45,13 +45,11 @@ private:
        };
 
 private:
-       typedef std::map<std::string, BuildType> BuildTypeMap;
-
        PackageManager package_manager;
 
        Architecture native_arch;
        Architecture *current_arch;
-       BuildTypeMap build_types;
+       std::map<std::string, BuildType> build_types;
        BuildType *build_type;
        Toolchain toolchain;
        VirtualFileSystem vfs;
index 94b8f52e2bda19245801438ba0127251f3fe2e9a..1952f594bd7daece578b4d7e65e1608ba5044097 100644 (file)
@@ -353,7 +353,7 @@ void BuilderCLI::package_help()
 
        SourcePackage &main_pkg = dynamic_cast<SourcePackage &>(package_manager.get_main_package());
        const Config &config = main_pkg.get_config();
-       const Config::OptionMap &options = config.get_options();
+       const auto &options = config.get_options();
        const Package::Requirements &requires = main_pkg.get_required_packages();
 
        if(!requires.empty() || !options.empty())
index 77e58ca9b472c2081fca80946b2a267229633096..28388a01b169533290db8e8190388b1c934b5905 100644 (file)
@@ -12,9 +12,7 @@ Provides a command-line interface for Builder.
 class BuilderCLI: public Msp::RegisteredApplication<BuilderCLI>
 {
 private:
-       typedef std::list<std::string> NameList;
-
-       NameList cmdline_targets;
+       std::list<std::string> cmdline_targets;
        Config::InputOptions cmdline_options;
        Msp::FS::Path cwd;
 
@@ -29,7 +27,7 @@ private:
        bool show_progress;
        std::string build_file;
        unsigned jobs;
-       NameList what_if;
+       std::list<std::string> what_if;
        bool conf_all;
        bool conf_only;
        bool build_all;
index 1636e27ae714b3706f78605c16e008708bd19787..371b5447e2e01291f8e902103a34d3cb12065565 100644 (file)
@@ -12,12 +12,9 @@ Manages a graph of targets.
 */
 class BuildGraph
 {
-public:
-       typedef std::map<std::string, Target *> TargetMap;
-
 private:
        Builder &builder;
-       TargetMap targets;
+       std::map<std::string, Target *> targets;
        Target *goals;
 
 public:
@@ -27,7 +24,7 @@ public:
        /** Looks up a target by name.  Returns 0 if no such target exists. */
        Target *get_target(const std::string &) const;
 
-       const TargetMap &get_targets() const { return targets; }
+       const std::map<std::string, Target *> &get_targets() const { return targets; }
 
        /** Adds a target.  It can later be retrieved by name.  Called from Target
        constructor. */
index c0584002233512392849dd7a6097de40bc02f1a6..f84315c74369b7b73f6f4e839ff0a8701193627f 100644 (file)
@@ -73,7 +73,7 @@ public:
        class Tracked
        {
        public:
-               typedef T LoadType;
+               using LoadType = T;
 
        private:
                T value;
@@ -89,23 +89,17 @@ public:
                operator const T &() const { return value; }
        };
 
-       typedef std::map<std::string, std::string> DefineMap;
-       typedef std::list<Msp::FS::Path> PathList;
-       typedef std::list<std::string> WordList;
-       typedef std::map<std::string, LibraryMode> LibModeMap;
-       typedef std::map<std::string, LanguageStandard> StandardMap;
-
        Tracked<Msp::FS::Path> sysroot;
-       DefineMap defines;
-       PathList incpath;
-       PathList local_incpath;
-       PathList libpath;
-       WordList libs;
+       std::map<std::string, std::string> defines;
+       std::list<Msp::FS::Path> incpath;
+       std::list<Msp::FS::Path> local_incpath;
+       std::list<Msp::FS::Path> libpath;
+       std::list<std::string> libs;
        Tracked<LibraryMode> libmode;
        Tracked<RuntimePathMode> rpath_mode;
-       LibModeMap libmodes;
-       WordList keep_symbols;
-       StandardMap standards;
+       std::map<std::string, LibraryMode> libmodes;
+       std::list<std::string> keep_symbols;
+       std::map<std::string, LanguageStandard> standards;
        Tracked<bool> threads;
        Tracked<bool> debug;
        Tracked<int> optimize;
index 57b16d118ecd01cc27f99626e89cd9a5866ca475..229783a002b92cf9b966e0459f010b028a1df490 100644 (file)
@@ -65,7 +65,7 @@ Cache::Cache(SourcePackage &p):
 
 void Cache::set_value(const Target *tgt, const string &k, const string &v)
 {
-       ValueList vl;
+       Values vl;
        vl.push_back(v);
        set_values(tgt, k, vl);
 }
@@ -75,13 +75,13 @@ void Cache::append_value(const Target *tgt, const string &k, const string &v)
        Key key(tgt->get_name(), k);
        auto i = data.find(key);
        if(i==data.end())
-               i = data.insert({ key, ValueList() }).first;
+               i = data.insert({ key, Values() }).first;
        i->second.push_back(v);
        changed = true;
        package.get_builder().get_logger().log("cache", format("Updated key %s %s+ %s", tgt->get_name(), k, v));
 }
 
-void Cache::set_values(const Target *tgt, const string &k, const ValueList &v)
+void Cache::set_values(const Target *tgt, const string &k, const Values &v)
 {
        data[Key(tgt->get_name(), k)] = v;
        changed = true;
@@ -90,13 +90,13 @@ void Cache::set_values(const Target *tgt, const string &k, const ValueList &v)
 
 const string &Cache::get_value(const Target *tgt, const string &k)
 {
-       const ValueList &values = get_values(tgt, k);
+       const Values &values = get_values(tgt, k);
        if(values.empty())
                throw logic_error("values.empty()");
        return values.front();
 }
 
-const Cache::ValueList &Cache::get_values(const Target *tgt, const string &k)
+const Cache::Values &Cache::get_values(const Target *tgt, const string &k)
 {
        return get_item(data, Key(tgt->get_name(), k));
 }
@@ -120,7 +120,7 @@ void Cache::load()
                        key.second = read_string(in);
                        if(key.first.empty() || key.second.empty())
                                break;
-                       ValueList &values = data[key];
+                       Values &values = data[key];
                        for(unsigned count = read_count(in); count; --count)
                                values.push_back(read_string(in));
                        package.get_builder().get_logger().log("cache", format("Loaded key %s %s: %s", key.first, key.second, join(values.begin(), values.end())));
index 69025fd97911613d6f3dfbda2a14a9fb408d1cf9..cf7253f717586982f98699d15485dd54d4272766 100644 (file)
@@ -20,14 +20,13 @@ unprintable characters or nuls.
 class Cache
 {
 public:
-       typedef std::list<std::string> ValueList;
+       using Values = std::list<std::string>;
 private:
-       typedef std::pair<std::string, std::string> Key;
-       typedef std::map<Key, ValueList> DataMap;
+       using Key = std::pair<std::string, std::string>;
 
        SourcePackage &package;
        Msp::FS::Path filename;
-       DataMap data;
+       std::map<Key, Values> data;
        Msp::Time::TimeStamp mtime;
        mutable bool changed;
 
@@ -41,14 +40,14 @@ public:
        void append_value(const Target *, const std::string &, const std::string &);
 
        /// Sets a key to a list of values, replacing any existing values.
-       void set_values(const Target *, const std::string &, const ValueList &);
+       void set_values(const Target *, const std::string &, const Values &);
 
        /** Returns the first value from a key.  The key must exist and be
        non-empty. */
        const std::string &get_value(const Target *, const std::string &);
 
        /// Returns the values from a key.  The key must exist.
-       const ValueList &get_values(const Target *, const std::string &);
+       const Values &get_values(const Target *, const std::string &);
 
        /// Indicates whether a key exists.
        bool has_key(const Target *, const std::string &);
index 963625122005f7fdff8837ba5372deaf0cd4f02a..98b6ff76590e1067709895ed1277d6535ed61e58 100644 (file)
@@ -88,14 +88,14 @@ BuildInfo Component::get_build_info_for_path(const FS::Path &path) const
        return binfo;
 }
 
-Component::SourceList Component::collect_source_files() const
+list<FS::Path> Component::collect_source_files() const
 {
-       SourceList files;
+       list<FS::Path> files;
        for(const FS::Path &p: sources)
        {
                if(FS::is_dir(p))
                {
-                       SourceList dirs;
+                       list<FS::Path> dirs;
                        dirs.push_back(p);
                        for(const string &o: overlays)
                        {
index 0e1efad028d5d627b69e6e59f32c5b4d60ce7d34..1db925928a9a88cea2221bf98fbc7736cfd0a412 100644 (file)
@@ -32,14 +32,11 @@ public:
                void source(const std::string &);
        };
 
-       typedef std::list<Msp::FS::Path> SourceList;
-       typedef std::list<std::string> OverlayList;
-
 protected:
        SourcePackage &package;
        std::string name;
-       SourceList sources;
-       OverlayList overlays;
+       std::list<Msp::FS::Path> sources;
+       std::list<std::string> overlays;
        bool install;
        BuildInfo build_info;
        Package::Requirements requires;
@@ -56,13 +53,13 @@ public:
 
        /** Returns a list of sources for the component.  They may refer to
        directories or individual files. */
-       const SourceList &get_sources() const { return sources; }
+       const std::list<Msp::FS::Path> &get_sources() const { return sources; }
 
-       const OverlayList &get_overlays() const { return overlays; }
+       const std::list<std::string> &get_overlays() const { return overlays; }
 
 protected:
        /** Returns a list of all source files for the component. */
-       SourceList collect_source_files() const;
+       std::list<Msp::FS::Path> collect_source_files() const;
 
 public:
        bool get_install() const { return install; }
index 3257794671530e119edcc9de67a9f78633d2d0c6..a82e53685c390b0fdc7e528b1a2ad9a71b3199b2 100644 (file)
@@ -25,8 +25,7 @@ public:
                Option(const Feature &);
        };
 
-       typedef std::map<std::string, Option> OptionMap;
-       typedef std::map<std::string, std::string> InputOptions;
+       using InputOptions = std::map<std::string, std::string>;
 
 private:
        class Loader: public Msp::DataFile::ObjectLoader<Config>
@@ -38,7 +37,7 @@ private:
        };
 
        SourcePackage &package;
-       OptionMap options;
+       std::map<std::string, Option> options;
        InputOptions pending_options;
        Msp::Time::TimeStamp mtime;
        mutable bool changed;
@@ -57,7 +56,7 @@ public:
        /** Gets a configuration option by name. */
        const Option &get_option(const std::string &) const;
 
-       const OptionMap &get_options() const { return options; }
+       const std::map<std::string, Option> &get_options() const { return options; }
        const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
 
        void load();
index 954fdba72927c8b4417d177094b2de849e3306c8..41dbd437cc836b75697342381f590b1c09f89fc4 100644 (file)
@@ -54,8 +54,8 @@ void CSourceFile::find_dependencies()
        }
 
        const BuildInfo &build_info = component->get_build_info_for_path(path);
-       const BuildInfo::PathList &incpath = build_info.incpath;
-       BuildInfo::PathList local_incpath = incpath;
+       const auto &incpath = build_info.incpath;
+       VirtualFileSystem::SearchPath local_incpath = incpath;
        local_incpath.insert(local_incpath.begin(), build_info.local_incpath.begin(), build_info.local_incpath.end());
        local_incpath.push_front(FS::dirname(path).str());
 
index 55809b094c71e3babf04a77f308d6346aeb01d8a..e585721892d0ae16f793333d70aafacaaa6fa42f 100644 (file)
@@ -9,18 +9,15 @@ Represents a C or C++ source file.
 */
 class CSourceFile: public SourceFile
 {
-public:
-       typedef std::list<std::string> IncludeList;
-
 protected:
-       IncludeList includes;
+       std::list<std::string> includes;
 
 public:
        CSourceFile(Builder &, const Msp::FS::Path &);
        CSourceFile(Builder &, const Component &, const Msp::FS::Path &);
 
        const char *get_type() const override { return "CSourceFile"; }
-       const IncludeList &get_includes() const { return includes; }
+       const std::list<std::string> &get_includes() const { return includes; }
 protected:
        virtual void parse_includes(Msp::IO::Base &);
        void find_dependencies() override;
index 81b2e9ed98156449e09552a0bfd5872ab54e09e4..f676f4acb10c961d83f32fb0cca10f126131fdfe 100644 (file)
@@ -5,10 +5,8 @@
 
 class DataPack: public FileTarget
 {
-public:
-       typedef std::list<FileTarget *> FileList;
 private:
-       FileList files;
+       std::list<FileTarget *> files;
 
 public:
        DataPack(Builder &, const Component &, const std::list<FileTarget *> &);
@@ -18,7 +16,7 @@ private:
 public:
        const char *get_type() const override { return "DataPack"; }
 
-       const FileList &get_files() const { return files; }
+       const std::list<FileTarget *> &get_files() const { return files; }
 };
 
 #endif
index 80796139da36d9bf27b62f731d3dbc5b3aea3233..3de1e4ac139946f26654f1fda57a2dbb65fef2ae 100644 (file)
@@ -24,7 +24,7 @@ public:
                IGNORE        //< Redirect the stream to oblivion
        };
 
-       typedef Msp::Process::Arguments Arguments;
+       using Arguments = Msp::Process::Arguments;
 
 private:
        Arguments argv;
index 4048f1c5fefbe362b2dc0e358475cad70bd4b024..7a2901679deed67df744220b87e1cb84f5aa4c50 100644 (file)
@@ -232,7 +232,7 @@ Task *GnuLinker::Linker::run(const Target &target) const
 {
        const Binary &bin = dynamic_cast<const Binary &>(target);
 
-       vector<string> argv;
+       ExternalTask::Arguments argv;
        argv.push_back(executable->get_path().str());
 
        FS::Path work_dir = bin.get_component()->get_package().get_source_directory();
index 34049d0ce9129ec4de87a3f35a367e22c7d72cee..a7ae7d4546e1b3d534e3112e5123d756beec914f 100644 (file)
@@ -27,7 +27,7 @@ public:
                void require(const std::string &);
        };
 
-       typedef std::list<Package *> Requirements;
+       using Requirements = std::list<Package *>;
 
 protected:
        Builder &builder;
index b168d723e174739c3c652f376f7f1cefe407cda2..9da4af33e3a557851c7dc7f9d23c54e235412edf 100644 (file)
@@ -15,19 +15,14 @@ packages by name.
 */
 class PackageManager
 {
-public:
-       typedef std::map<std::string, Package *> PackageMap;
-
 private:
-       typedef std::list<Msp::FS::Path> SearchPath;
-
        Builder &builder;
-       SearchPath pkg_path;
-       SearchPath pkg_dirs;
-       SearchPath binpkg_path;
-       SearchPath binpkg_files;
+       std::list<Msp::FS::Path> pkg_path;
+       std::list<Msp::FS::Path> pkg_dirs;
+       std::list<Msp::FS::Path> binpkg_path;
+       std::list<Msp::FS::Path> binpkg_files;
        bool no_externals;
-       PackageMap packages;
+       std::map<std::string, Package *> packages;
        Package *main_pkg;
        std::set<std::string> not_found;
        bool env_set;
@@ -55,7 +50,7 @@ public:
        the primary build target. */
        Package &get_main_package() const;
 
-       const PackageMap &get_packages() const { return packages; }
+       const std::map<std::string, Package *> &get_packages() const { return packages; }
 
        /** Locates a package and loads it if necessary. */
        Package *find_package(const std::string &);
index fce58a659fdd925f5b18411ff06035890d6797ca..cb2ab9d46676b0cf3f437281e73326370522e681 100644 (file)
@@ -46,11 +46,7 @@ public:
                void version(const std::string &);
        };
 
-       typedef std::list<Component *> ComponentList;
-
 private:
-       typedef std::list<Feature> FeatureList;
-
        std::string version;
        std::string interface_version;
        std::string description;
@@ -59,9 +55,9 @@ private:
        Msp::FS::Path source_dir;
        const BuildType *build_type;
        Toolchain local_tools;
-       FeatureList features;
+       std::list<Feature> features;
        BuildInfo build_info;
-       ComponentList components;
+       std::list<Component *> components;
        SourceArchiveComponent *source_archive;
        Config config;
        mutable Cache cache;
index e7150c205deb0d1b274b63da6a0194abd3161299..c4a822b48df43f5747479c67bc7e955ee0ce1031 100644 (file)
@@ -27,7 +27,7 @@ dependencies can be used by other targets further down the chain.
 class Target
 {
 public:
-       typedef std::list<Target *> Dependencies;
+       using Dependencies = std::list<Target *>;
 
 protected:
        enum State
index ee1fa7a1d4be81bce006281adc1b9dfb3a40314a..fa18ba8dca338d57c5e37c2c8fe42269f61ef1b1 100644 (file)
@@ -5,6 +5,7 @@
 #include <string>
 #include <msp/fs/path.h>
 #include "buildinfo.h"
+#include "virtualfilesystem.h"
 
 class Architecture;
 class Builder;
@@ -28,19 +29,16 @@ public:
                COMPONENT
        };
 
-       typedef std::list<Msp::FS::Path> SearchPath;
-       typedef std::list<std::string> SuffixList;
-
 protected:
        Builder &builder;
        const Architecture *architecture;
        std::string tag;
        std::string command;
        FileTarget *executable;
-       SuffixList input_suffixes;
-       SuffixList aux_suffixes;
+       std::list<std::string> input_suffixes;
+       std::list<std::string> aux_suffixes;
        ProcessingUnit processing_unit;
-       SearchPath system_path;
+       VirtualFileSystem::SearchPath system_path;
        BuildInfo build_info;
        bool prepared;
        std::list<std::string> problems;
@@ -68,11 +66,11 @@ public:
        FileTarget *get_executable() const { return executable; }
 
        /// Returns a list of suffixes that can be processed with this tool.
-       const SuffixList &get_input_suffixes() const { return input_suffixes; }
+       const std::list<std::string> &get_input_suffixes() const { return input_suffixes; }
 
        /** Returns a list of suffixes that are associated with this tool, but can't
        be processed directly.  For example C and C++ headers. */
-       const SuffixList &get_auxiliary_suffixes() const { return aux_suffixes; }
+       const std::list<std::string> &get_auxiliary_suffixes() const { return aux_suffixes; }
 
        /** Indicates whether the tool can accept a suffix.  If aux is true,
        auxiliary suffixes are considered as well */
@@ -82,7 +80,7 @@ public:
        ProcessingUnit get_processing_unit() const { return processing_unit; }
 
        /// Returns the systemwide search path for source files.
-       const SearchPath &get_system_path() const { return system_path; }
+       const VirtualFileSystem::SearchPath &get_system_path() const { return system_path; }
 
        /** Returns tool-specific build info.  This can be used by other tools down
        the chain. */
index 8449680409884d12d2801dc760212fa70e8db886..a70cdb7308557f5762ce9d45a7bf3bb188be1f03 100644 (file)
@@ -13,11 +13,8 @@ A container for tools.  Performs lookup based on tag or filename extension.
 class Toolchain
 {
 private:
-       typedef std::map<std::string, Tool *> ToolMap;
-       typedef std::list<Toolchain *> ToolchainList;
-
-       ToolMap tools;
-       ToolchainList chains;
+       std::map<std::string, Tool *> tools;
+       std::list<Toolchain *> chains;
 
 public:
        ~Toolchain();
index 7855e04ac99bc148bbbc2dbd4c685fafd01214e3..783583f7798d2f9228b92a954bb93e387b7606cd 100644 (file)
@@ -44,10 +44,10 @@ FileTarget *VirtualFileSystem::find_header(const string &name, Tool *tool, const
 
        tool->prepare();
 
-       list<FS::Path> combined_path(path.begin(), path.end());
+       SearchPath combined_path = path;
        if(use_syspath)
        {
-               const Tool::SearchPath &syspath = tool->get_system_path();
+               const SearchPath &syspath = tool->get_system_path();
                combined_path.insert(combined_path.end(), syspath.begin(), syspath.end());
        }
 
@@ -73,12 +73,12 @@ FileTarget *VirtualFileSystem::find_header(const string &name, Tool *tool, const
 
 FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath &path, BuildInfo::LibraryMode mode, bool use_syspath)
 {
-       list<FS::Path> combined_path(path.begin(), path.end());
+       SearchPath combined_path = path;
        if(use_syspath)
        {
                Tool &linker = builder.get_toolchain().get_tool("LINK");
                linker.prepare();
-               const Tool::SearchPath &syspath = linker.get_system_path();
+               const SearchPath &syspath = linker.get_system_path();
                combined_path.insert(combined_path.end(), syspath.begin(), syspath.end());
        }
 
index a3327de2490001c1f3e3c349ac284e66fb9c7611..d74872c2d5dba9365d9e08c717625c45afcb0661 100644 (file)
@@ -10,6 +10,7 @@
 class Builder;
 class FileTarget;
 class Pattern;
+class Tool;
 
 /**
 Provides access to the filesystem in a way that takes known targets into
@@ -19,13 +20,11 @@ possible to build them.
 class VirtualFileSystem
 {
 public:
-       typedef std::list<Msp::FS::Path> SearchPath;
+       using SearchPath = std::list<Msp::FS::Path>;
 
 private:
-       typedef std::map<Msp::FS::Path, FileTarget *> TargetMap;
-
        Builder &builder;
-       TargetMap targets;
+       std::map<Msp::FS::Path, FileTarget *> targets;
        std::set<Msp::FS::Path> nonexistent;
 
 public: