Clean up HPHP flags a little bit

Some of this is trivial stuff -- flags that aren't even referenced except to read
them from the command line. I removed a few more that weren't used in
any meaningful way.

I figure we could also stand to remove --nofork, since "freeing up
memory for g++" isn't a concern anymore, but I figured it might still be
useful somehow.
Esse commit está contido em:
Owen Yamauchi
2013-05-30 09:39:13 -07:00
commit de Sara Golemon
commit 494adcb2f4
6 arquivos alterados com 12 adições e 60 exclusões
+12 -17
Ver Arquivo
@@ -131,8 +131,8 @@ public:
public:
CodeGenerator() {} // only for creating a dummy code generator
CodeGenerator(std::ostream *primary, Output output = PickledPHP,
const std::string *filename = nullptr);
explicit CodeGenerator(std::ostream *primary, Output output = PickledPHP,
const std::string *filename = nullptr);
/**
* ...if it was passed in from constructor.
@@ -314,21 +314,16 @@ private:
std::string getFormattedName(const std::string &file);
};
#define STR(x) #x
#define XSTR(x) STR(x)
#define FLANN(stream,func,nl) (Option::FlAnnotate ? \
stream.printf("/* %s:" XSTR(__LINE__) "*/" nl, __func__): \
void()), stream.func
#define cg_printf FLANN(cg,printf,"")
#define m_cg_printf FLANN(m_cg,printf,"")
#define cg_print FLANN(cg,print,"")
#define m_cg_print FLANN(m_cg,print,"")
#define cg_indentBegin FLANN(cg,indentBegin,"")
#define m_cg_indentBegin FLANN(m_cg,indentBegin,"")
#define cg_indentEnd FLANN(cg,indentEnd,"")
#define m_cg_indentEnd FLANN(m_cg,indentEnd,"")
#define cg_printInclude FLANN(cg,printInclude,"\n")
#define cg_printString FLANN(cg,printString,"")
#define cg_printf cg.printf
#define m_cg_printf m_cg.printf
#define cg_print cg.print
#define m_cg_print m_cg.print
#define cg_indentBegin cg.indentBegin
#define m_cg_indentBegin m_cg.indentBegin
#define cg_indentEnd cg.indentEnd
#define m_cg_indentEnd cg.indentEnd
#define cg_printInclude cg.printInclude
#define cg_printString cg.printString
///////////////////////////////////////////////////////////////////////////////
}
-33
Ver Arquivo
@@ -63,7 +63,6 @@ struct CompilerOptions {
string target;
string format;
string outputDir;
string outputFile;
string syncDir;
vector<string> config;
string configDir;
@@ -84,8 +83,6 @@ struct CompilerOptions {
vector<string> cfiles;
vector<string> cmodules;
bool parseOnDemand;
vector<string> parseOnDemandDirs; // parse these directories on-demand
// when parseOnDemand=false
string program;
string programArgs;
string branch;
@@ -94,21 +91,15 @@ struct CompilerOptions {
bool keepTempDir;
string dbStats;
bool noTypeInference;
bool noMinInclude;
bool noMetaInfo;
int logLevel;
bool force;
int clusterCount;
int optimizeLevel;
string filecache;
string javaRoot;
bool dump;
string docjson;
bool coredump;
bool nofork;
bool fl_annotate;
string optimizations;
string ppp;
};
///////////////////////////////////////////////////////////////////////////////
@@ -235,9 +226,6 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
" <any combination of them by any separator>; \n"
"hhbc: binary (default) | text; \n"
"run: cluster (default) | file")
("cluster-count", value<int>(&po.clusterCount)->default_value(0),
"Cluster by file sizes and output roughly these many number of files. "
"Use 0 for no clustering.")
("input-dir", value<string>(&po.inputDir), "input directory")
("program", value<string>(&po.program)->default_value("program"),
"final program name to use")
@@ -284,7 +272,6 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
("branch", value<string>(&po.branch), "SVN branch")
("revision", value<int>(&po.revision), "SVN revision")
("output-dir,o", value<string>(&po.outputDir), "output directory")
("output-file", value<string>(&po.outputFile), "output file")
("sync-dir", value<string>(&po.syncDir),
"Files will be created in this directory first, then sync with output "
"directory without overwriting identical files. Great for incremental "
@@ -301,13 +288,6 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
("no-type-inference",
value<bool>(&po.noTypeInference)->default_value(false),
"turn off type inference for C++ code generation")
("no-min-include",
value<bool>(&po.noMinInclude)->default_value(false),
"turn off minimium include analysis when target is \"analyze\"")
("no-meta-info",
value<bool>(&po.noMetaInfo)->default_value(false),
"do not generate class map, function jump table and macros "
"when generating code; good for demo purposes")
("config,c", value<vector<string> >(&po.config)->composing(),
"config file name")
("config-dir", value<string>(&po.configDir),
@@ -339,19 +319,9 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
value<bool>(&po.nofork)->default_value(false),
"forking is needed for large compilation to release memory before g++"
"compilation. turning off forking can help gdb debugging.")
("fl-annotate",
value<bool>(&po.fl_annotate)->default_value(false),
"Annotate emitted source with compiler file-line info")
("opts",
value<string>(&po.optimizations)->default_value(""),
"Set optimizations to enable/disable")
("ppp",
value<string>(&po.ppp)->default_value(""),
"Preprocessed partition configuration. To speed up distcc compilation, "
"bin/ppp.php can pre-compute better partition between different .cpp "
"files according to preprocessed file sizes, instead of original file "
"sizes (default). Run bin/ppp.php to generate an HDF configuration file "
"to specify here.")
("compiler-id", "display the git hash for the compiler id")
("repo-schema", "display the repo schema id used by this app")
;
@@ -421,8 +391,6 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
Logger::LogLevel = Logger::LogInfo;
}
Option::FlAnnotate = po.fl_annotate;
Hdf config;
for (vector<string>::const_iterator it = po.config.begin();
it != po.config.end(); ++it) {
@@ -479,7 +447,6 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
}
Option::ProgramName = po.program;
Option::PreprocessedPartitionConfig = po.ppp;
if (po.format.empty()) {
if (po.target == "php") {
@@ -158,10 +158,7 @@ ExpressionPtr ClassConstantExpression::preOptimize(AnalysisResultConstPtr ar) {
}
ExpressionPtr rep = Clone(value, getScope());
bool annotate = Option::FlAnnotate;
Option::FlAnnotate = false; // avoid nested comments on getText
rep->setComment(getText());
Option::FlAnnotate = annotate;
rep->setLocation(getLocation());
return replaceValue(rep);
}
@@ -194,10 +194,7 @@ ExpressionPtr ConstantExpression::preOptimize(AnalysisResultConstPtr ar) {
}
}
ExpressionPtr rep = Clone(value, getScope());
bool annotate = Option::FlAnnotate;
Option::FlAnnotate = false; // avoid nested comments on getText
rep->setComment(getText());
Option::FlAnnotate = annotate;
rep->setLocation(getLocation());
return replaceValue(rep);
}
-2
Ver Arquivo
@@ -110,7 +110,6 @@ int Option::CodeErrorMaxProgram = 1;
Option::EvalLevel Option::EnableEval = NoEval;
std::string Option::ProgramName;
std::string Option::PreprocessedPartitionConfig;
bool Option::ParseTimeOpts = true;
bool Option::EnableHipHopSyntax = false;
@@ -156,7 +155,6 @@ StringBag Option::OptionStrings;
bool Option::GenerateCppLibCode = false;
bool Option::GenerateSourceInfo = false;
bool Option::GenerateDocComments = true;
bool Option::FlAnnotate = false;
void (*Option::m_hookHandler)(Hdf &config);
bool (*Option::PersistenceHook)(BlockScopeRawPtr scope, FileScopeRawPtr file);
-2
Ver Arquivo
@@ -224,7 +224,6 @@ public:
static EvalLevel EnableEval;
static std::string ProgramName;
static std::string PreprocessedPartitionConfig; // generated by ppp.php
static bool ParseTimeOpts;
static bool OutputHHBC;
@@ -267,7 +266,6 @@ public:
static bool GenerateCppLibCode;
static bool GenerateSourceInfo;
static bool GenerateDocComments;
static bool FlAnnotate; // annotate emitted code with compiler file-line info
static bool ControlFlow;
static bool VariableCoalescing;
static bool DumpAst;