aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-07-28 00:48:05 +0000
committerFangrui Song <maskray@google.com>2018-07-28 00:48:05 +0000
commit8e4ee77b16eaae6b330d5059933fff25bec51d3b (patch)
treee4510171afdc1844e63af86043d21c819fb0323e /include
parent459648c52ee1c2cc321223d61aae39b169104e9c (diff)
downloadclang-8e4ee77b16eaae6b330d5059933fff25bec51d3b.tar.gz
[CFG] Remove duplicate function/class names at the beginning of comments
Some functions/classes have renamed while the comments still use the old names. Delete them per coding style. Also some whitespace cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h4
-rw-r--r--include/clang/Analysis/CFG.h117
-rw-r--r--include/clang/Analysis/CFGStmtMap.h8
3 files changed, 61 insertions, 68 deletions
diff --git a/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h b/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
index da59514c4f..49da6815ac 100644
--- a/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
+++ b/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
@@ -23,7 +23,7 @@ namespace clang {
class CFG;
class CFGBlock;
-
+
// A class that performs reachability queries for CFGBlocks. Several internal
// checks in this checker require reachability information. The requests all
// tend to have a common destination, so we lazily do a predecessor search
@@ -45,7 +45,7 @@ public:
private:
void mapReachability(const CFGBlock *Dst);
};
-
+
} // namespace clang
#endif // LLVM_CLANG_ANALYSIS_ANALYSES_CFGREACHABILITYANALYSIS_H
diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h
index f25789822d..9c996688df 100644
--- a/include/clang/Analysis/CFG.h
+++ b/include/clang/Analysis/CFG.h
@@ -51,7 +51,7 @@ class FieldDecl;
class LangOptions;
class VarDecl;
-/// CFGElement - Represents a top-level expression in a basic block.
+/// Represents a top-level expression in a basic block.
class CFGElement {
public:
enum Kind {
@@ -144,9 +144,9 @@ protected:
CFGStmt() = default;
};
-/// CFGConstructor - Represents C++ constructor call. Maintains information
-/// necessary to figure out what memory is being initialized by the
-/// constructor expression. For now this is only used by the analyzer's CFG.
+/// Represents C++ constructor call. Maintains information necessary to figure
+/// out what memory is being initialized by the constructor expression. For now
+/// this is only used by the analyzer's CFG.
class CFGConstructor : public CFGStmt {
public:
explicit CFGConstructor(CXXConstructExpr *CE, const ConstructionContext *C)
@@ -169,12 +169,12 @@ private:
}
};
-/// CFGCXXRecordTypedCall - Represents a function call that returns a C++ object
-/// by value. This, like constructor, requires a construction context in order
-/// to understand the storage of the returned object . In C such tracking is not
-/// necessary because no additional effort is required for destroying the object
-/// or modeling copy elision. Like CFGConstructor, this element is for now only
-/// used by the analyzer's CFG.
+/// Represents a function call that returns a C++ object by value. This, like
+/// constructor, requires a construction context in order to understand the
+/// storage of the returned object . In C such tracking is not necessary because
+/// no additional effort is required for destroying the object or modeling copy
+/// elision. Like CFGConstructor, this element is for now only used by the
+/// analyzer's CFG.
class CFGCXXRecordTypedCall : public CFGStmt {
public:
/// Returns true when call expression \p CE needs to be represented
@@ -210,8 +210,8 @@ private:
}
};
-/// CFGInitializer - Represents C++ base or member initializer from
-/// constructor's initialization list.
+/// Represents C++ base or member initializer from constructor's initialization
+/// list.
class CFGInitializer : public CFGElement {
public:
explicit CFGInitializer(CXXCtorInitializer *initializer)
@@ -231,7 +231,7 @@ private:
}
};
-/// CFGNewAllocator - Represents C++ allocator call.
+/// Represents C++ allocator call.
class CFGNewAllocator : public CFGElement {
public:
explicit CFGNewAllocator(const CXXNewExpr *S)
@@ -349,8 +349,8 @@ private:
}
};
-/// CFGImplicitDtor - Represents C++ object destructor implicitly generated
-/// by compiler on various occasions.
+/// Represents C++ object destructor implicitly generated by compiler on various
+/// occasions.
class CFGImplicitDtor : public CFGElement {
protected:
CFGImplicitDtor() = default;
@@ -373,9 +373,9 @@ private:
}
};
-/// CFGAutomaticObjDtor - Represents C++ object destructor implicitly generated
-/// for automatic object or temporary bound to const reference at the point
-/// of leaving its local scope.
+/// Represents C++ object destructor implicitly generated for automatic object
+/// or temporary bound to const reference at the point of leaving its local
+/// scope.
class CFGAutomaticObjDtor: public CFGImplicitDtor {
public:
CFGAutomaticObjDtor(const VarDecl *var, const Stmt *stmt)
@@ -400,8 +400,7 @@ private:
}
};
-/// CFGDeleteDtor - Represents C++ object destructor generated
-/// from a call to delete.
+/// Represents C++ object destructor generated from a call to delete.
class CFGDeleteDtor : public CFGImplicitDtor {
public:
CFGDeleteDtor(const CXXRecordDecl *RD, const CXXDeleteExpr *DE)
@@ -426,8 +425,8 @@ private:
}
};
-/// CFGBaseDtor - Represents C++ object destructor implicitly generated for
-/// base object in destructor.
+/// Represents C++ object destructor implicitly generated for base object in
+/// destructor.
class CFGBaseDtor : public CFGImplicitDtor {
public:
CFGBaseDtor(const CXXBaseSpecifier *base)
@@ -447,8 +446,8 @@ private:
}
};
-/// CFGMemberDtor - Represents C++ object destructor implicitly generated for
-/// member object in destructor.
+/// Represents C++ object destructor implicitly generated for member object in
+/// destructor.
class CFGMemberDtor : public CFGImplicitDtor {
public:
CFGMemberDtor(const FieldDecl *field)
@@ -468,8 +467,8 @@ private:
}
};
-/// CFGTemporaryDtor - Represents C++ object destructor implicitly generated
-/// at the end of full expression for temporary object.
+/// Represents C++ object destructor implicitly generated at the end of full
+/// expression for temporary object.
class CFGTemporaryDtor : public CFGImplicitDtor {
public:
CFGTemporaryDtor(CXXBindTemporaryExpr *expr)
@@ -489,7 +488,7 @@ private:
}
};
-/// CFGTerminator - Represents CFGBlock terminator statement.
+/// Represents CFGBlock terminator statement.
///
/// TemporaryDtorsBranch bit is set to true if the terminator marks a branch
/// in control flow of destructors of temporaries. In this case terminator
@@ -520,7 +519,7 @@ public:
explicit operator bool() const { return getStmt(); }
};
-/// CFGBlock - Represents a single basic block in a source-level CFG.
+/// Represents a single basic block in a source-level CFG.
/// It consists of:
///
/// (1) A set of statements/expressions (which may contain subexpressions).
@@ -588,26 +587,24 @@ class CFGBlock {
bool empty() const { return Impl.empty(); }
};
- /// Stmts - The set of statements in the basic block.
+ /// The set of statements in the basic block.
ElementList Elements;
- /// Label - An (optional) label that prefixes the executable
- /// statements in the block. When this variable is non-NULL, it is
- /// either an instance of LabelStmt, SwitchCase or CXXCatchStmt.
+ /// An (optional) label that prefixes the executable statements in the block.
+ /// When this variable is non-NULL, it is either an instance of LabelStmt,
+ /// SwitchCase or CXXCatchStmt.
Stmt *Label = nullptr;
- /// Terminator - The terminator for a basic block that
- /// indicates the type of control-flow that occurs between a block
- /// and its successors.
+ /// The terminator for a basic block that indicates the type of control-flow
+ /// that occurs between a block and its successors.
CFGTerminator Terminator;
- /// LoopTarget - Some blocks are used to represent the "loop edge" to
- /// the start of a loop from within the loop body. This Stmt* will be
- /// refer to the loop statement for such blocks (and be null otherwise).
+ /// Some blocks are used to represent the "loop edge" to the start of a loop
+ /// from within the loop body. This Stmt* will be refer to the loop statement
+ /// for such blocks (and be null otherwise).
const Stmt *LoopTarget = nullptr;
- /// BlockID - A numerical ID assigned to a CFGBlock during construction
- /// of the CFG.
+ /// A numerical ID assigned to a CFGBlock during construction of the CFG.
unsigned BlockID;
public:
@@ -629,7 +626,7 @@ public:
public:
/// Construct an AdjacentBlock with a possibly unreachable block.
AdjacentBlock(CFGBlock *B, bool IsReachable);
-
+
/// Construct an AdjacentBlock with a reachable block and an alternate
/// unreachable block.
AdjacentBlock(CFGBlock *B, CFGBlock *AlternateBlock);
@@ -665,13 +662,12 @@ public:
};
private:
- /// Predecessors/Successors - Keep track of the predecessor / successor
- /// CFG blocks.
+ /// Keep track of the predecessor / successor CFG blocks.
using AdjacentBlocks = BumpVector<AdjacentBlock>;
AdjacentBlocks Preds;
AdjacentBlocks Succs;
- /// NoReturn - This bit is set when the basic block contains a function call
+ /// This bit is set when the basic block contains a function call
/// or implicit destructor that is attributed as 'noreturn'. In that case,
/// control cannot technically ever proceed past this block. All such blocks
/// will have a single immediate successor: the exit block. This allows them
@@ -682,7 +678,7 @@ private:
/// storage if the memory usage of CFGBlock becomes an issue.
unsigned HasNoReturnElement : 1;
- /// Parent - The parent CFG that owns this CFGBlock.
+ /// The parent CFG that owns this CFGBlock.
CFG *Parent;
public:
@@ -992,7 +988,7 @@ public:
bool isAlwaysTrue) {}
};
-/// CFG - Represents a source-level, intra-procedural CFG that represents the
+/// Represents a source-level, intra-procedural CFG that represents the
/// control-flow of a Stmt. The Stmt can represent an entire function body,
/// or a single expression. A CFG will always contain one empty block that
/// represents the Exit point of the CFG. A CFG will also contain a designated
@@ -1044,21 +1040,21 @@ public:
}
};
- /// buildCFG - Builds a CFG from an AST.
+ /// Builds a CFG from an AST.
static std::unique_ptr<CFG> buildCFG(const Decl *D, Stmt *AST, ASTContext *C,
const BuildOptions &BO);
- /// createBlock - Create a new block in the CFG. The CFG owns the block;
- /// the caller should not directly free it.
+ /// Create a new block in the CFG. The CFG owns the block; the caller should
+ /// not directly free it.
CFGBlock *createBlock();
- /// setEntry - Set the entry block of the CFG. This is typically used
- /// only during CFG construction. Most CFG clients expect that the
- /// entry block has no predecessors and contains no statements.
+ /// Set the entry block of the CFG. This is typically used only during CFG
+ /// construction. Most CFG clients expect that the entry block has no
+ /// predecessors and contains no statements.
void setEntry(CFGBlock *B) { Entry = B; }
- /// setIndirectGotoBlock - Set the block used for indirect goto jumps.
- /// This is typically used only during CFG construction.
+ /// Set the block used for indirect goto jumps. This is typically used only
+ /// during CFG construction.
void setIndirectGotoBlock(CFGBlock *B) { IndirectGotoBlock = B; }
//===--------------------------------------------------------------------===//
@@ -1152,8 +1148,8 @@ public:
template <typename CALLBACK>
void VisitBlockStmts(CALLBACK& O) const {
- for (const_iterator I=begin(), E=end(); I != E; ++I)
- for (CFGBlock::const_iterator BI=(*I)->begin(), BE=(*I)->end();
+ for (const_iterator I = begin(), E = end(); I != E; ++I)
+ for (CFGBlock::const_iterator BI = (*I)->begin(), BE = (*I)->end();
BI != BE; ++BI) {
if (Optional<CFGStmt> stmt = BI->getAs<CFGStmt>())
O(const_cast<Stmt*>(stmt->getStmt()));
@@ -1164,13 +1160,12 @@ public:
// CFG Introspection.
//===--------------------------------------------------------------------===//
- /// getNumBlockIDs - Returns the total number of BlockIDs allocated (which
- /// start at 0).
+ /// Returns the total number of BlockIDs allocated (which start at 0).
unsigned getNumBlockIDs() const { return NumBlockIDs; }
- /// size - Return the total number of CFGBlocks within the CFG
- /// This is simply a renaming of the getNumBlockIDs(). This is necessary
- /// because the dominator implementation needs such an interface.
+ /// Return the total number of CFGBlocks within the CFG This is simply a
+ /// renaming of the getNumBlockIDs(). This is necessary because the dominator
+ /// implementation needs such an interface.
unsigned size() const { return NumBlockIDs; }
//===--------------------------------------------------------------------===//
diff --git a/include/clang/Analysis/CFGStmtMap.h b/include/clang/Analysis/CFGStmtMap.h
index 4dfa91df0f..78e637daf3 100644
--- a/include/clang/Analysis/CFGStmtMap.h
+++ b/include/clang/Analysis/CFGStmtMap.h
@@ -19,20 +19,18 @@
namespace clang {
-class CFG;
-class CFGBlock;
class ParentMap;
class Stmt;
class CFGStmtMap {
ParentMap *PM;
void *M;
-
+
CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}
-
+
public:
~CFGStmtMap();
-
+
/// Returns a new CFGMap for the given CFG. It is the caller's
/// responsibility to 'delete' this object when done using it.
static CFGStmtMap *Build(CFG* C, ParentMap *PM);