aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-04 13:12:48 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-04 13:12:48 +0000
commitc54061a679d8db4169438b2f97f81e3f443c6a25 (patch)
tree044a790aa777a9cd73967044dab098a779d4a1f2
parent77d4ee2bfc90b77ec8b818de985cd4aceeef757b (diff)
Move private structs into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126997 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ExprConstant.cpp34
-rw-r--r--lib/Sema/SemaDeclCXX.cpp14
2 files changed, 25 insertions, 23 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 3a5eb66ea1..c8f470376a 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -42,25 +42,25 @@ using llvm::APFloat;
/// rules. For example, the RHS of (0 && foo()) is not evaluated. We can
/// evaluate the expression regardless of what the RHS is, but C only allows
/// certain things in certain situations.
-struct EvalInfo {
- const ASTContext &Ctx;
-
- /// EvalResult - Contains information about the evaluation.
- Expr::EvalResult &EvalResult;
-
- llvm::DenseMap<const OpaqueValueExpr*, APValue> OpaqueValues;
- const APValue *getOpaqueValue(const OpaqueValueExpr *e) {
- llvm::DenseMap<const OpaqueValueExpr*, APValue>::iterator
- i = OpaqueValues.find(e);
- if (i == OpaqueValues.end()) return 0;
- return &i->second;
- }
+namespace {
+ struct EvalInfo {
+ const ASTContext &Ctx;
+
+ /// EvalResult - Contains information about the evaluation.
+ Expr::EvalResult &EvalResult;
+
+ typedef llvm::DenseMap<const OpaqueValueExpr*, APValue> MapTy;
+ MapTy OpaqueValues;
+ const APValue *getOpaqueValue(const OpaqueValueExpr *e) const {
+ MapTy::const_iterator i = OpaqueValues.find(e);
+ if (i == OpaqueValues.end()) return 0;
+ return &i->second;
+ }
- EvalInfo(const ASTContext &ctx, Expr::EvalResult& evalresult)
- : Ctx(ctx), EvalResult(evalresult) {}
-};
+ EvalInfo(const ASTContext &ctx, Expr::EvalResult &evalresult)
+ : Ctx(ctx), EvalResult(evalresult) {}
+ };
-namespace {
struct ComplexValue {
private:
bool IsInt;
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 118c9f68f0..623e72f299 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -2854,12 +2854,14 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
}
/// \brief Data used with FindHiddenVirtualMethod
-struct FindHiddenVirtualMethodData {
- Sema *S;
- CXXMethodDecl *Method;
- llvm::SmallPtrSet<const CXXMethodDecl *, 8> OverridenAndUsingBaseMethods;
- llvm::SmallVector<CXXMethodDecl *, 8> OverloadedMethods;
-};
+namespace {
+ struct FindHiddenVirtualMethodData {
+ Sema *S;
+ CXXMethodDecl *Method;
+ llvm::SmallPtrSet<const CXXMethodDecl *, 8> OverridenAndUsingBaseMethods;
+ llvm::SmallVector<CXXMethodDecl *, 8> OverloadedMethods;
+ };
+}
/// \brief Member lookup function that determines whether a given C++
/// method overloads virtual methods in a base class without overriding any,