[cfe-commits] r112949 - in /cfe/trunk/lib: Checker/IdempotentOperationChecker.cpp Checker/MallocChecker.cpp Checker/SimpleSValuator.cpp Checker/StreamChecker.cpp Rewrite/DeltaTree.cpp Sema/SemaStmt.cpp

Chris Lattner sabre at nondot.org
Thu Sep 2 21:34:38 PDT 2010


Author: lattner
Date: Thu Sep  2 23:34:38 2010
New Revision: 112949

URL: http://llvm.org/viewvc/llvm-project?rev=112949&view=rev
Log:
"I see dead code".  IdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's usefulIdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's useful

Modified:
    cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp
    cfe/trunk/lib/Checker/MallocChecker.cpp
    cfe/trunk/lib/Checker/SimpleSValuator.cpp
    cfe/trunk/lib/Checker/StreamChecker.cpp
    cfe/trunk/lib/Rewrite/DeltaTree.cpp
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp (original)
+++ cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Thu Sep  2 23:34:38 2010
@@ -78,8 +78,8 @@
     // False positive reduction methods
     static bool isSelfAssign(const Expr *LHS, const Expr *RHS);
     static bool isUnused(const Expr *E, AnalysisContext *AC);
-    static bool isTruncationExtensionAssignment(const Expr *LHS,
-                                                const Expr *RHS);
+    //static bool isTruncationExtensionAssignment(const Expr *LHS,
+    //                                            const Expr *RHS);
     static bool PathWasCompletelyAnalyzed(const CFG *C,
                                           const CFGBlock *CB,
                                           const GRCoreEngine &CE);
@@ -500,6 +500,7 @@
   return true;
 }
 
+#if 0
 // Check for self casts truncating/extending a variable
 bool IdempotentOperationChecker::isTruncationExtensionAssignment(
                                                               const Expr *LHS,
@@ -522,6 +523,7 @@
 
   return dyn_cast<DeclRefExpr>(RHS->IgnoreParens()) == NULL;
 }
+#endif
 
 // Returns false if a path to this block was not completely analyzed, or true
 // otherwise.

Modified: cfe/trunk/lib/Checker/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/MallocChecker.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/MallocChecker.cpp (original)
+++ cfe/trunk/lib/Checker/MallocChecker.cpp Thu Sep  2 23:34:38 2010
@@ -32,10 +32,10 @@
   RefState(Kind k, const Stmt *s) : K(k), S(s) {}
 
   bool isAllocated() const { return K == AllocateUnchecked; }
-  bool isFailed() const { return K == AllocateFailed; }
+  //bool isFailed() const { return K == AllocateFailed; }
   bool isReleased() const { return K == Released; }
-  bool isEscaped() const { return K == Escaped; }
-  bool isRelinquished() const { return K == Relinquished; }
+  //bool isEscaped() const { return K == Escaped; }
+  //bool isRelinquished() const { return K == Relinquished; }
 
   bool operator==(const RefState &X) const {
     return K == X.K && S == X.S;

Modified: cfe/trunk/lib/Checker/SimpleSValuator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/SimpleSValuator.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/SimpleSValuator.cpp (original)
+++ cfe/trunk/lib/Checker/SimpleSValuator.cpp Thu Sep  2 23:34:38 2010
@@ -848,8 +848,6 @@
       rightI.extOrTrunc(leftI.getBitWidth());
 
       // Offset the increment by the pointer size.
-      ASTContext &ctx = ValMgr.getContext();
-      const PointerType *PT = resultTy->getAs<PointerType>();
       llvm::APSInt Multiplicand(rightI.getBitWidth(), /* isUnsigned */ true);
       rightI *= Multiplicand;
       

Modified: cfe/trunk/lib/Checker/StreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/StreamChecker.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/StreamChecker.cpp (original)
+++ cfe/trunk/lib/Checker/StreamChecker.cpp Thu Sep  2 23:34:38 2010
@@ -31,8 +31,8 @@
 
   bool isOpened() const { return K == Opened; }
   bool isClosed() const { return K == Closed; }
-  bool isOpenFailed() const { return K == OpenFailed; }
-  bool isEscaped() const { return K == Escaped; }
+  //bool isOpenFailed() const { return K == OpenFailed; }
+  //bool isEscaped() const { return K == Escaped; }
 
   bool operator==(const StreamState &X) const {
     return K == X.K && S == X.S;

Modified: cfe/trunk/lib/Rewrite/DeltaTree.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/DeltaTree.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/DeltaTree.cpp (original)
+++ cfe/trunk/lib/Rewrite/DeltaTree.cpp Thu Sep  2 23:34:38 2010
@@ -116,7 +116,7 @@
 
     void Destroy();
 
-    static inline bool classof(const DeltaTreeNode *) { return true; }
+    //static inline bool classof(const DeltaTreeNode *) { return true; }
   };
 } // end anonymous namespace
 
@@ -133,12 +133,6 @@
   public:
     DeltaTreeInteriorNode() : DeltaTreeNode(false /*nonleaf*/) {}
 
-    DeltaTreeInteriorNode(DeltaTreeNode *FirstChild)
-    : DeltaTreeNode(false /*nonleaf*/) {
-      FullDelta = FirstChild->FullDelta;
-      Children[0] = FirstChild;
-    }
-
     DeltaTreeInteriorNode(const InsertResult &IR)
       : DeltaTreeNode(false /*nonleaf*/) {
       Children[0] = IR.LHS;
@@ -157,7 +151,7 @@
       return Children[i];
     }
 
-    static inline bool classof(const DeltaTreeInteriorNode *) { return true; }
+  //static inline bool classof(const DeltaTreeInteriorNode *) { return true; }
     static inline bool classof(const DeltaTreeNode *N) { return !N->isLeaf(); }
   };
 }

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=112949&r1=112948&r2=112949&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Sep  2 23:34:38 2010
@@ -1576,7 +1576,6 @@
     return t == other.t;
   }
 
-  QualType getQualType() const { return t; }
   CXXCatchStmt *getCatchStmt() const { return stmt; }
   SourceLocation getTypeSpecStartLoc() const {
     return stmt->getExceptionDecl()->getTypeSpecStartLoc();





More information about the cfe-commits mailing list