r206386 - Minor formatting cleanups -- no functional changes intended.
Aaron Ballman
aaron at aaronballman.com
Wed Apr 16 06:16:19 PDT 2014
Author: aaronballman
Date: Wed Apr 16 08:16:19 2014
New Revision: 206386
URL: http://llvm.org/viewvc/llvm-project?rev=206386&view=rev
Log:
Minor formatting cleanups -- no functional changes intended.
Modified:
cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h?rev=206386&r1=206385&r2=206386&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h Wed Apr 16 08:16:19 2014
@@ -219,6 +219,18 @@ public:
{}
};
+ SExprBuilder(til::MemRegionRef A)
+ : Arena(A), SelfVar(nullptr), Scfg(nullptr), CallCtx(nullptr),
+ CurrentBB(nullptr), CurrentBlockID(0), CurrentVarID(0),
+ CurrentArgIndex(0) {
+ // FIXME: we don't always have a self-variable.
+ SelfVar = new (Arena)til::Variable(til::Variable::VK_SFun);
+ }
+
+ ~SExprBuilder() {
+ delete CallCtx;
+ }
+
// Translate a clang statement or expression to a TIL expression.
// Also performs substitution of variables; Ctx provides the context.
// Dispatches on the type of S.
@@ -226,7 +238,8 @@ public:
til::SCFG *buildCFG(CFGWalker &Walker);
til::SExpr *lookupStmt(const Stmt *S);
- til::SCFG *getCFG() const { return Scfg; }
+ const til::SCFG *getCFG() const { return Scfg; }
+ til::SCFG *getCFF() { return Scfg; }
private:
til::SExpr *translateDeclRefExpr(const DeclRefExpr *DRE,
@@ -252,12 +265,11 @@ private:
til::SExpr *translateDeclStmt(const DeclStmt *S, CallingContext *Ctx);
-private:
// Used for looking the index of a name.
- typedef llvm::DenseMap<const ValueDecl*, unsigned> NameIndexMap;
+ typedef llvm::DenseMap<const ValueDecl *, unsigned> NameIndexMap;
// Used for looking up the current SSA variable for a name, by index.
- typedef CopyOnWriteVector<std::pair<const ValueDecl*, til::SExpr*> >
+ typedef CopyOnWriteVector<std::pair<const ValueDecl *, til::SExpr *>>
NameVarMap;
struct BlockInfo {
@@ -299,29 +311,13 @@ private:
void mergeEntryMap(NameVarMap Map);
-public:
- SExprBuilder(til::MemRegionRef A)
- : Arena(A), SelfVar(nullptr), Scfg(nullptr), CallCtx(nullptr),
- CurrentBB(nullptr), CurrentBlockID(0), CurrentVarID(0),
- CurrentArgIndex(0)
- {
- // FIXME: we don't always have a self-variable.
- SelfVar = new (Arena) til::Variable(til::Variable::VK_SFun);
- }
-
- ~SExprBuilder() {
- if (CallCtx)
- delete CallCtx;
- }
-
-private:
til::MemRegionRef Arena;
til::Variable *SelfVar; // Variable to use for 'this'. May be null.
til::SCFG *Scfg;
StatementMap SMap; // Map from Stmt to TIL Variables
NameIndexMap IdxMap; // Indices of clang local vars.
- std::vector<til::BasicBlock*> BlockMap; // Map from clang to til BBs.
+ std::vector<til::BasicBlock *> BlockMap; // Map from clang to til BBs.
std::vector<BlockInfo> BBInfo; // Extra information per BB.
// Indexed by clang BlockID.
SExprBuilder::CallingContext *CallCtx; // Root calling context
Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h?rev=206386&r1=206385&r2=206386&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h Wed Apr 16 08:16:19 2014
@@ -1108,7 +1108,7 @@ public:
return Visitor.reducePhi(*this, Nvs);
}
- template <class C> typename C::CType compare(Phi* E, C &Cmp) {
+ template <class C> typename C::CType compare(Phi *E, C &Cmp) {
// TODO: implement CFG comparisons
return Cmp.comparePointers(this, E);
}
More information about the cfe-commits
mailing list