зеркало из https://github.com/microsoft/clang-1.git
Get rid of mostly-unused, buggy method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
d01a0bc444
Коммит
d933a0198f
|
@ -257,11 +257,6 @@ public:
|
||||||
/// cast to void*.
|
/// cast to void*.
|
||||||
bool isNullPointerConstant(ASTContext &Ctx) const;
|
bool isNullPointerConstant(ASTContext &Ctx) const;
|
||||||
|
|
||||||
/// hasGlobalStorage - Return true if this expression has static storage
|
|
||||||
/// duration. This means that the address of this expression is a link-time
|
|
||||||
/// constant.
|
|
||||||
bool hasGlobalStorage() const;
|
|
||||||
|
|
||||||
/// isOBJCGCCandidate - Return true if this expression may be used in a read/
|
/// isOBJCGCCandidate - Return true if this expression may be used in a read/
|
||||||
/// write barrier.
|
/// write barrier.
|
||||||
bool isOBJCGCCandidate(ASTContext &Ctx) const;
|
bool isOBJCGCCandidate(ASTContext &Ctx) const;
|
||||||
|
|
|
@ -926,44 +926,6 @@ Expr::isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc) const {
|
||||||
return MLV_Valid;
|
return MLV_Valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// hasGlobalStorage - Return true if this expression has static storage
|
|
||||||
/// duration. This means that the address of this expression is a link-time
|
|
||||||
/// constant.
|
|
||||||
bool Expr::hasGlobalStorage() const {
|
|
||||||
switch (getStmtClass()) {
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
case BlockExprClass:
|
|
||||||
return true;
|
|
||||||
case ParenExprClass:
|
|
||||||
return cast<ParenExpr>(this)->getSubExpr()->hasGlobalStorage();
|
|
||||||
case ImplicitCastExprClass:
|
|
||||||
return cast<ImplicitCastExpr>(this)->getSubExpr()->hasGlobalStorage();
|
|
||||||
case CompoundLiteralExprClass:
|
|
||||||
return cast<CompoundLiteralExpr>(this)->isFileScope();
|
|
||||||
case DeclRefExprClass:
|
|
||||||
case QualifiedDeclRefExprClass: {
|
|
||||||
const Decl *D = cast<DeclRefExpr>(this)->getDecl();
|
|
||||||
if (const VarDecl *VD = dyn_cast<VarDecl>(D))
|
|
||||||
return VD->hasGlobalStorage();
|
|
||||||
if (isa<FunctionDecl>(D))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case MemberExprClass:
|
|
||||||
case CXXQualifiedMemberExprClass: {
|
|
||||||
const MemberExpr *M = cast<MemberExpr>(this);
|
|
||||||
return !M->isArrow() && M->getBase()->hasGlobalStorage();
|
|
||||||
}
|
|
||||||
case ArraySubscriptExprClass:
|
|
||||||
return cast<ArraySubscriptExpr>(this)->getBase()->hasGlobalStorage();
|
|
||||||
case PredefinedExprClass:
|
|
||||||
return true;
|
|
||||||
case CXXDefaultArgExprClass:
|
|
||||||
return cast<CXXDefaultArgExpr>(this)->getExpr()->hasGlobalStorage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// isOBJCGCCandidate - Check if an expression is objc gc'able.
|
/// isOBJCGCCandidate - Check if an expression is objc gc'able.
|
||||||
///
|
///
|
||||||
bool Expr::isOBJCGCCandidate(ASTContext &Ctx) const {
|
bool Expr::isOBJCGCCandidate(ASTContext &Ctx) const {
|
||||||
|
|
|
@ -187,14 +187,14 @@ static bool EvaluateLValue(const Expr* E, APValue& Result, EvalInfo &Info) {
|
||||||
|
|
||||||
APValue LValueExprEvaluator::VisitDeclRefExpr(DeclRefExpr *E)
|
APValue LValueExprEvaluator::VisitDeclRefExpr(DeclRefExpr *E)
|
||||||
{
|
{
|
||||||
if (!E->hasGlobalStorage())
|
|
||||||
return APValue();
|
|
||||||
|
|
||||||
if (isa<FunctionDecl>(E->getDecl())) {
|
if (isa<FunctionDecl>(E->getDecl())) {
|
||||||
return APValue(E, 0);
|
return APValue(E, 0);
|
||||||
} else if (VarDecl* VD = dyn_cast<VarDecl>(E->getDecl())) {
|
} else if (VarDecl* VD = dyn_cast<VarDecl>(E->getDecl())) {
|
||||||
|
if (!VD->hasGlobalStorage())
|
||||||
|
return APValue();
|
||||||
if (!VD->getType()->isReferenceType())
|
if (!VD->getType()->isReferenceType())
|
||||||
return APValue(E, 0);
|
return APValue(E, 0);
|
||||||
|
// FIXME: Check whether VD might be overridden!
|
||||||
if (VD->getInit())
|
if (VD->getInit())
|
||||||
return Visit(VD->getInit());
|
return Visit(VD->getInit());
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче