From c1705cb7c800e82189d61d88d10fef839b94ec1b Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Mon, 20 May 2013 23:31:52 -0700 Subject: [PATCH] !bool != bool I should have tested it :( While I was in there debugging I found some dead code Closes #771 --- hphp/compiler/expression/constant_expression.cpp | 2 +- hphp/compiler/expression/simple_function_call.cpp | 6 +++--- hphp/compiler/expression/simple_function_call.h | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hphp/compiler/expression/constant_expression.cpp b/hphp/compiler/expression/constant_expression.cpp index 5c0c89869..1e3aed8ed 100644 --- a/hphp/compiler/expression/constant_expression.cpp +++ b/hphp/compiler/expression/constant_expression.cpp @@ -119,7 +119,7 @@ bool ConstantExpression::canonCompare(ExpressionPtr e) const { Symbol *ConstantExpression::resolveNS(AnalysisResultConstPtr ar) { BlockScopeConstPtr block = ar->findConstantDeclarer(m_name); if (!block) { - if (hadBackslash()) { + if (!hadBackslash() && Option::WholeProgram) { int pos = m_name.rfind('\\'); m_name = m_name.substr(pos + 1); block = ar->findConstantDeclarer(m_name); diff --git a/hphp/compiler/expression/simple_function_call.cpp b/hphp/compiler/expression/simple_function_call.cpp index f6f8d40d2..c13dba92d 100644 --- a/hphp/compiler/expression/simple_function_call.cpp +++ b/hphp/compiler/expression/simple_function_call.cpp @@ -101,7 +101,7 @@ SimpleFunctionCall::SimpleFunctionCall : FunctionCall(EXPRESSION_CONSTRUCTOR_PARAMETER_VALUES(SimpleFunctionCall), ExpressionPtr(), name, hadBackslash, params, cls), m_type(UnknownType), m_dynamicConstant(false), - m_builtinFunction(false), m_noPrefix(false), m_fromCompiler(false), + m_builtinFunction(false), m_fromCompiler(false), m_dynamicInvoke(false), m_transformed(false), m_no_volatile_check(false), m_safe(0), m_extra(nullptr) { @@ -248,7 +248,7 @@ void SimpleFunctionCall::setupScopes(AnalysisResultConstPtr ar) { if (!m_class && m_className.empty()) { if (!m_dynamicInvoke) { func = ar->findFunction(m_name); - if (!func && hadBackslash()) { + if (!func && !hadBackslash() && Option::WholeProgram) { int pos = m_name.rfind('\\'); m_name = m_name.substr(pos + 1); func = ar->findFunction(m_name); @@ -462,7 +462,7 @@ void SimpleFunctionCall::analyzeProgram(AnalysisResultPtr ar) { markRefParams(m_funcScope, m_name, canInvokeFewArgs()); } } else if (ar->getPhase() == AnalysisResult::AnalyzeFinal) { - if (!m_fromCompiler && !m_noPrefix && m_type == UnknownType && + if (!m_fromCompiler && m_type == UnknownType && !m_class && !m_redeclared && !m_dynamicInvoke && !m_funcScope && (m_className.empty() || (m_classScope && diff --git a/hphp/compiler/expression/simple_function_call.h b/hphp/compiler/expression/simple_function_call.h index 3d514c59d..03ec6b3a3 100644 --- a/hphp/compiler/expression/simple_function_call.h +++ b/hphp/compiler/expression/simple_function_call.h @@ -40,9 +40,8 @@ public: bool isDefineWithoutImpl(AnalysisResultConstPtr ar); void setValid() { m_valid = true; } - void setNoPrefix() { m_noPrefix = true; } void setFromCompiler() { m_fromCompiler = true; } - void setThrowFatal() { m_noPrefix = true; m_type = ThrowFatalFunction; } + void setThrowFatal() { m_type = ThrowFatalFunction; } int isFatalFunction() const { return m_type == ThrowFatalFunction; } int isStaticCompact() const { return m_type == StaticCompactFunction; } @@ -101,7 +100,6 @@ protected: int m_type; unsigned m_dynamicConstant : 1; unsigned m_builtinFunction : 1; - unsigned m_noPrefix : 1; unsigned m_fromCompiler : 1; unsigned m_invokeFewArgsDecision : 1; unsigned m_dynamicInvoke : 1;