summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp14
-rw-r--r--clang/lib/Analysis/LiveVariables.cpp10
-rw-r--r--clang/lib/Analysis/PseudoConstantAnalysis.cpp30
-rw-r--r--clang/lib/Analysis/ReachableCode.cpp2
-rw-r--r--clang/lib/Analysis/UninitializedValues.cpp4
5 files changed, 30 insertions, 30 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index da7f36a132c..3720d20c288 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -526,15 +526,15 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
// See if this is a known constant.
TryResult KnownVal = TryEvaluateBool(B->getLHS());
- if (KnownVal.isKnown() && (B->getOpcode() == BinaryOperator::LOr))
+ if (KnownVal.isKnown() && (B->getOpcode() == BO_LOr))
KnownVal.negate();
// Now link the LHSBlock with RHSBlock.
- if (B->getOpcode() == BinaryOperator::LOr) {
+ if (B->getOpcode() == BO_LOr) {
AddSuccessor(LHSBlock, KnownVal.isTrue() ? NULL : ConfluenceBlock);
AddSuccessor(LHSBlock, KnownVal.isFalse() ? NULL : RHSBlock);
} else {
- assert(B->getOpcode() == BinaryOperator::LAnd);
+ assert(B->getOpcode() == BO_LAnd);
AddSuccessor(LHSBlock, KnownVal.isFalse() ? NULL : RHSBlock);
AddSuccessor(LHSBlock, KnownVal.isTrue() ? NULL : ConfluenceBlock);
}
@@ -543,7 +543,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
Block = LHSBlock;
return addStmt(B->getLHS());
}
- else if (B->getOpcode() == BinaryOperator::Comma) { // ,
+ else if (B->getOpcode() == BO_Comma) { // ,
autoCreateBlock();
AppendStmt(Block, B, asc);
addStmt(B->getRHS());
@@ -2084,10 +2084,10 @@ public:
B->getLHS()->printPretty(OS, Helper, Policy);
switch (B->getOpcode()) {
- case BinaryOperator::LOr:
+ case BO_LOr:
OS << " || ...";
return;
- case BinaryOperator::LAnd:
+ case BO_LAnd:
OS << " && ...";
return;
default:
@@ -2130,7 +2130,7 @@ static void print_stmt(llvm::raw_ostream &OS, StmtPrinterHelper* Helper,
// special printing for comma expressions.
if (BinaryOperator* B = dyn_cast<BinaryOperator>(Terminator)) {
- if (B->getOpcode() == BinaryOperator::Comma) {
+ if (B->getOpcode() == BO_Comma) {
OS << "... , ";
Helper->handledStmt(B->getRHS(),OS);
OS << '\n';
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp
index 4efe25ea1e0..3011fd0dee4 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -229,10 +229,10 @@ void TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {
Expr *E = U->getSubExpr();
switch (U->getOpcode()) {
- case UnaryOperator::PostInc:
- case UnaryOperator::PostDec:
- case UnaryOperator::PreInc:
- case UnaryOperator::PreDec:
+ case UO_PostInc:
+ case UO_PostDec:
+ case UO_PreInc:
+ case UO_PreDec:
// Walk through the subexpressions, blasting through ParenExprs
// until we either find a DeclRefExpr or some non-DeclRefExpr
// expression.
@@ -268,7 +268,7 @@ void TransferFuncs::VisitAssign(BinaryOperator* B) {
// Handle things like +=, etc., which also generate "uses"
// of a variable. Do this just by visiting the subexpression.
- if (B->getOpcode() != BinaryOperator::Assign)
+ if (B->getOpcode() != BO_Assign)
VisitDeclRefExpr(DR);
}
}
diff --git a/clang/lib/Analysis/PseudoConstantAnalysis.cpp b/clang/lib/Analysis/PseudoConstantAnalysis.cpp
index 5deabacea43..42ebe9c2371 100644
--- a/clang/lib/Analysis/PseudoConstantAnalysis.cpp
+++ b/clang/lib/Analysis/PseudoConstantAnalysis.cpp
@@ -91,7 +91,7 @@ void PseudoConstantAnalysis::RunAnalysis() {
// for any of the assignment operators, implying that this Decl is being
// written to.
switch (BO->getOpcode()) {
- case BinaryOperator::Assign: {
+ case BO_Assign: {
const Expr *RHS = BO->getRHS()->IgnoreParenCasts();
if (const DeclRefExpr *RHSDecl = dyn_cast<DeclRefExpr>(RHS)) {
// Self-assignments don't count as use of a variable
@@ -101,15 +101,15 @@ void PseudoConstantAnalysis::RunAnalysis() {
}
}
- case BinaryOperator::AddAssign:
- case BinaryOperator::SubAssign:
- case BinaryOperator::MulAssign:
- case BinaryOperator::DivAssign:
- case BinaryOperator::AndAssign:
- case BinaryOperator::OrAssign:
- case BinaryOperator::XorAssign:
- case BinaryOperator::ShlAssign:
- case BinaryOperator::ShrAssign: {
+ case BO_AddAssign:
+ case BO_SubAssign:
+ case BO_MulAssign:
+ case BO_DivAssign:
+ case BO_AndAssign:
+ case BO_OrAssign:
+ case BO_XorAssign:
+ case BO_ShlAssign:
+ case BO_ShrAssign: {
// The DeclRefExpr is being assigned to - mark it as non-constant
const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl());
if (VD)
@@ -137,12 +137,12 @@ void PseudoConstantAnalysis::RunAnalysis() {
// check for any of the increment/decrement operators, as well as
// addressOf.
switch (UO->getOpcode()) {
- case UnaryOperator::PostDec:
- case UnaryOperator::PostInc:
- case UnaryOperator::PreDec:
- case UnaryOperator::PreInc:
+ case UO_PostDec:
+ case UO_PostInc:
+ case UO_PreDec:
+ case UO_PreInc:
// The DeclRefExpr is being changed - mark it as non-constant
- case UnaryOperator::AddrOf: {
+ case UO_AddrOf: {
// If we are taking the address of the DeclRefExpr, assume it is
// non-constant.
const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl());
diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp
index f959e5cd43e..05439392f91 100644
--- a/clang/lib/Analysis/ReachableCode.cpp
+++ b/clang/lib/Analysis/ReachableCode.cpp
@@ -41,7 +41,7 @@ top:
switch (S->getStmtClass()) {
case Expr::BinaryOperatorClass: {
const BinaryOperator *BO = cast<BinaryOperator>(S);
- if (BO->getOpcode() == BinaryOperator::Comma) {
+ if (BO->getOpcode() == BO_Comma) {
if (sn+1 < b.size())
return b[sn+1].getStmt()->getLocStart();
const CFGBlock *n = &b;
diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp
index 7a628642dc9..0f43efa58cc 100644
--- a/clang/lib/Analysis/UninitializedValues.cpp
+++ b/clang/lib/Analysis/UninitializedValues.cpp
@@ -121,7 +121,7 @@ bool TransferFuncs::VisitBinaryOperator(BinaryOperator* B) {
if (VarDecl* VD = FindBlockVarDecl(B->getLHS()))
if (B->isAssignmentOp()) {
- if (B->getOpcode() == BinaryOperator::Assign)
+ if (B->getOpcode() == BO_Assign)
return V(VD,AD) = Visit(B->getRHS());
else // Handle +=, -=, *=, etc. We do want '&', not '&&'.
return V(VD,AD) = Visit(B->getLHS()) & Visit(B->getRHS());
@@ -168,7 +168,7 @@ bool TransferFuncs::VisitCallExpr(CallExpr* C) {
bool TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {
switch (U->getOpcode()) {
- case UnaryOperator::AddrOf: {
+ case UO_AddrOf: {
VarDecl* VD = FindBlockVarDecl(U->getSubExpr());
if (VD && VD->isBlockVarDecl())
return V(VD,AD) = Initialized;
OpenPOWER on IntegriCloud