Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 5a4f98f

Browse files
committed
[analyzer] Refactoring: Move stuff into namespace 'GR'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122423 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a7af5ea commit 5a4f98f

File tree

118 files changed

+470
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+470
-196
lines changed

include/clang/Analysis/DomainSpecific/CocoaConventions.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/AST/Type.h"
1818

1919
namespace clang {
20+
namespace GR {
2021
namespace cocoa {
2122

2223
enum NamingConvention { NoConvention, CreateRule, InitRule };
@@ -34,6 +35,6 @@ namespace cocoa {
3435

3536
bool isCocoaObjectRef(QualType T);
3637

37-
}}
38+
}}}
3839

3940
#endif

include/clang/GR/AnalysisConsumer.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_CLANG_CHECKER_ANALYSISCONSUMER_H
16-
#define LLVM_CLANG_CHECKER_ANALYSISCONSUMER_H
15+
#ifndef LLVM_CLANG_GR_ANALYSISCONSUMER_H
16+
#define LLVM_CLANG_GR_ANALYSISCONSUMER_H
1717

1818
#include <string>
1919

@@ -23,13 +23,17 @@ class AnalyzerOptions;
2323
class ASTConsumer;
2424
class Preprocessor;
2525

26+
namespace GR {
27+
2628
/// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
2729
/// analysis passes. (The set of analyses run is controlled by command-line
2830
/// options.)
2931
ASTConsumer* CreateAnalysisConsumer(const Preprocessor &pp,
3032
const std::string &output,
3133
const AnalyzerOptions& Opts);
3234

33-
}
35+
} // end GR namespace
36+
37+
} // end clang namespace
3438

3539
#endif

include/clang/GR/BugReporter/BugReporter.h

+11-6
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_CLANG_ANALYSIS_BUGREPORTER
16-
#define LLVM_CLANG_ANALYSIS_BUGREPORTER
15+
#ifndef LLVM_CLANG_GR_BUGREPORTER
16+
#define LLVM_CLANG_GR_BUGREPORTER
1717

1818
#include "clang/Basic/SourceLocation.h"
1919
#include "clang/GR/PathSensitive/GRState.h"
@@ -25,20 +25,23 @@
2525

2626
namespace clang {
2727

28+
class ASTContext;
29+
class Diagnostic;
30+
class Stmt;
31+
class ParentMap;
32+
33+
namespace GR {
34+
2835
class PathDiagnostic;
2936
class PathDiagnosticPiece;
3037
class PathDiagnosticClient;
31-
class ASTContext;
32-
class Diagnostic;
3338
class ExplodedNode;
3439
class ExplodedGraph;
3540
class BugReporter;
3641
class BugReporterContext;
3742
class GRExprEngine;
3843
class GRState;
39-
class Stmt;
4044
class BugType;
41-
class ParentMap;
4245

4346
//===----------------------------------------------------------------------===//
4447
// Interface for individual bug reports.
@@ -476,6 +479,8 @@ void registerVarDeclsLastStore(BugReporterContext &BRC, const void *stmt,
476479

477480
//===----------------------------------------------------------------------===//
478481

482+
} // end GR namespace
483+
479484
} // end clang namespace
480485

481486
#endif

include/clang/GR/BugReporter/BugType.h

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
namespace clang {
2222

23+
namespace GR {
24+
2325
class ExplodedNode;
2426
class GRExprEngine;
2527

@@ -68,5 +70,7 @@ class BuiltinBug : public BugType {
6870
llvm::StringRef getDescription() const { return desc; }
6971
};
7072

73+
} // end GR namespace
74+
7175
} // end clang namespace
7276
#endif

include/clang/GR/BugReporter/PathDiagnostic.h

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class Decl;
2727
class SourceManager;
2828
class Stmt;
2929

30+
namespace GR {
31+
3032
//===----------------------------------------------------------------------===//
3133
// High-level interface for handlers of path-sensitive diagnostics.
3234
//===----------------------------------------------------------------------===//
@@ -490,5 +492,9 @@ class PathDiagnostic : public llvm::FoldingSetNode {
490492

491493
void Profile(llvm::FoldingSetNodeID &ID) const;
492494
};
495+
496+
} // end GR namespace
497+
493498
} //end clang namespace
499+
494500
#endif

include/clang/GR/Checkers/DereferenceChecker.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@
1313
//
1414
//===----------------------------------------------------------------------===//
1515

16-
#ifndef LLVM_CLANG_DEREFCHECKER
17-
#define LLVM_CLANG_DEREFCHECKER
16+
#ifndef LLVM_CLANG_GR_DEREFCHECKER
17+
#define LLVM_CLANG_GR_DEREFCHECKER
1818

1919
#include <utility>
2020

2121
namespace clang {
2222

23+
namespace GR {
24+
2325
class GRExprEngine;
2426
class ExplodedNode;
2527

2628
std::pair<ExplodedNode * const *, ExplodedNode * const *>
2729
GetImplicitNullDereferences(GRExprEngine &Eng);
2830

31+
} // end GR namespace
32+
2933
} // end clang namespace
3034

3135
#endif

include/clang/GR/Checkers/LocalCheckers.h

+13-7
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,30 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_CLANG_ANALYSIS_LOCALCHECKERS_H
16-
#define LLVM_CLANG_ANALYSIS_LOCALCHECKERS_H
15+
#ifndef LLVM_CLANG_GR_LOCALCHECKERS_H
16+
#define LLVM_CLANG_GR_LOCALCHECKERS_H
1717

1818
namespace clang {
1919

2020
class CFG;
2121
class Decl;
2222
class Diagnostic;
2323
class ASTContext;
24-
class PathDiagnosticClient;
25-
class GRTransferFuncs;
26-
class BugType;
2724
class LangOptions;
2825
class ParentMap;
2926
class LiveVariables;
30-
class BugReporter;
3127
class ObjCImplementationDecl;
3228
class LangOptions;
33-
class GRExprEngine;
3429
class TranslationUnitDecl;
3530

31+
namespace GR {
32+
33+
class PathDiagnosticClient;
34+
class GRTransferFuncs;
35+
class BugType;
36+
class BugReporter;
37+
class GRExprEngine;
38+
3639
void CheckDeadStores(CFG &cfg, LiveVariables &L, ParentMap &map,
3740
BugReporter& BR);
3841

@@ -56,6 +59,9 @@ void CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR);
5659
void CheckSizeofPointer(const Decl *D, BugReporter &BR);
5760

5861
void RegisterCallInliner(GRExprEngine &Eng);
62+
63+
} // end GR namespace
64+
5965
} // end namespace clang
6066

6167
#endif

include/clang/GR/FrontendActions.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef LLVM_CLANG_CHECKER_FRONTENDACTIONS_H
11-
#define LLVM_CLANG_CHECKER_FRONTENDACTIONS_H
10+
#ifndef LLVM_CLANG_GR_FRONTENDACTIONS_H
11+
#define LLVM_CLANG_GR_FRONTENDACTIONS_H
1212

1313
#include "clang/Frontend/FrontendAction.h"
1414

1515
namespace clang {
1616

17+
namespace GR {
18+
1719
//===----------------------------------------------------------------------===//
1820
// AST Consumer Actions
1921
//===----------------------------------------------------------------------===//
@@ -24,6 +26,8 @@ class AnalysisAction : public ASTFrontendAction {
2426
llvm::StringRef InFile);
2527
};
2628

27-
} // end namespace clang
29+
} // end GR namespace
30+
31+
} // end namespace clang
2832

2933
#endif

include/clang/GR/ManagerRegistry.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef LLVM_CLANG_ANALYSIS_MANAGER_REGISTRY_H
15-
#define LLVM_CLANG_ANALYSIS_MANAGER_REGISTRY_H
14+
#ifndef LLVM_CLANG_GR_MANAGER_REGISTRY_H
15+
#define LLVM_CLANG_GR_MANAGER_REGISTRY_H
1616

1717
#include "clang/GR/PathSensitive/GRState.h"
1818

1919
namespace clang {
2020

21+
namespace GR {
22+
2123
/// ManagerRegistry - This class records manager creators registered at
2224
/// runtime. The information is communicated to AnalysisManager through static
2325
/// members. Better design is expected.
@@ -49,5 +51,8 @@ class RegisterConstraintManager {
4951
}
5052
};
5153

52-
}
54+
} // end GR namespace
55+
56+
} // end clang namespace
57+
5358
#endif

include/clang/GR/PathDiagnosticClients.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#ifndef LLVM_CLANG_CHECKER_PATH_DIAGNOSTIC_CLIENTS_H
15-
#define LLVM_CLANG_CHECKER_PATH_DIAGNOSTIC_CLiENTS_H
14+
#ifndef LLVM_CLANG_GR_PATH_DIAGNOSTIC_CLIENTS_H
15+
#define LLVM_CLANG_GR_PATH_DIAGNOSTIC_CLiENTS_H
1616

1717
#include <string>
1818

1919
namespace clang {
2020

21-
class PathDiagnosticClient;
2221
class Preprocessor;
2322

23+
namespace GR {
24+
25+
class PathDiagnosticClient;
26+
2427
PathDiagnosticClient*
2528
createHTMLDiagnosticClient(const std::string& prefix, const Preprocessor &PP);
2629

@@ -32,5 +35,8 @@ PathDiagnosticClient*
3235
createTextPathDiagnosticClient(const std::string& prefix,
3336
const Preprocessor &PP);
3437

38+
} // end GR namespace
39+
3540
} // end clang namespace
41+
3642
#endif

include/clang/GR/PathSensitive/AnalysisManager.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_CLANG_ANALYSIS_ANALYSISMANAGER_H
16-
#define LLVM_CLANG_ANALYSIS_ANALYSISMANAGER_H
15+
#ifndef LLVM_CLANG_GR_ANALYSISMANAGER_H
16+
#define LLVM_CLANG_GR_ANALYSISMANAGER_H
1717

1818
#include "clang/Analysis/AnalysisContext.h"
1919
#include "clang/GR/BugReporter/BugReporter.h"
@@ -26,6 +26,8 @@ namespace idx {
2626
class TranslationUnit;
2727
}
2828

29+
namespace GR {
30+
2931
class AnalysisManager : public BugReporterData {
3032
AnalysisContextManager AnaCtxMgr;
3133
LocationContextManager LocCtxMgr;
@@ -199,6 +201,8 @@ class AnalysisManager : public BugReporterData {
199201
}
200202
};
201203

202-
}
204+
} // end GR namespace
205+
206+
} // end clang namespace
203207

204208
#endif

include/clang/GR/PathSensitive/BasicValueFactory.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
//
1414
//===----------------------------------------------------------------------===//
1515

16-
#ifndef LLVM_CLANG_ANALYSIS_BASICVALUEFACTORY_H
17-
#define LLVM_CLANG_ANALYSIS_BASICVALUEFACTORY_H
16+
#ifndef LLVM_CLANG_GR_BASICVALUEFACTORY_H
17+
#define LLVM_CLANG_GR_BASICVALUEFACTORY_H
1818

1919
#include "clang/GR/PathSensitive/SVals.h"
2020
#include "clang/AST/ASTContext.h"
@@ -24,6 +24,8 @@
2424

2525
namespace clang {
2626

27+
namespace GR {
28+
2729
class GRState;
2830

2931
class CompoundValData : public llvm::FoldingSetNode {
@@ -192,6 +194,8 @@ class BasicValueFactory {
192194
const SVal* getPersistentSVal(SVal X);
193195
};
194196

197+
} // end GR namespace
198+
195199
} // end clang namespace
196200

197201
#endif

include/clang/GR/PathSensitive/Checker.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#ifndef LLVM_CLANG_ANALYSIS_CHECKER
16-
#define LLVM_CLANG_ANALYSIS_CHECKER
15+
#ifndef LLVM_CLANG_GR_CHECKER
16+
#define LLVM_CLANG_GR_CHECKER
1717

1818
#include "clang/Analysis/Support/SaveAndRestore.h"
1919
#include "clang/GR/PathSensitive/GRExprEngine.h"
@@ -24,6 +24,8 @@
2424

2525
namespace clang {
2626

27+
namespace GR {
28+
2729
class CheckerContext {
2830
ExplodedNodeSet &Dst;
2931
GRStmtNodeBuilder &B;
@@ -298,6 +300,9 @@ class Checker {
298300
virtual void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B,
299301
GRExprEngine &Eng) {}
300302
};
303+
304+
} // end GR namespace
305+
301306
} // end clang namespace
302307

303308
#endif

0 commit comments

Comments
 (0)