view gen/configfile.h @ 1486:9ed0695cb93c

Teach `-dgc2stack` to promote GC allocations in simple loops to stack allocations too. (A "simple" loop is one where the allocation isn't used in a subsequent iteration) This also means it's no longer necessary to run this pass multiple times. Running it once after inlining should now catch all cases.
author Frits van Bommel <fvbommel wxs.nl>
date Mon, 08 Jun 2009 12:35:55 +0200
parents 7d3b47852a7a
children a048f31bf9f6
line wrap: on
line source

#ifndef LDC_CONF_CONFIGFILE_H
#define LDC_CONF_CONFIGFILE_H

#include <vector>
#include <string>

namespace libconfig
{
    class Config;
}

class ConfigFile
{
public:
    typedef std::vector<const char*>    s_vector;
    typedef s_vector::iterator          s_iterator;

public:
    ConfigFile();
    ~ConfigFile();

    bool read(const char* argv0, void* mainAddr, const char* filename);

    s_iterator switches_begin()   { return switches.begin(); }
    s_iterator switches_end()     { return switches.end(); }

    const std::string& path()     { return pathstr; }

private:
    libconfig::Config* cfg;
    std::string pathstr;

    s_vector switches;
};

#endif // LDC_CONF_CONFIGFILE_H