diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-04 13:12:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-04 13:12:48 +0000 |
commit | c54061a679d8db4169438b2f97f81e3f443c6a25 (patch) | |
tree | 044a790aa777a9cd73967044dab098a779d4a1f2 | |
parent | 77d4ee2bfc90b77ec8b818de985cd4aceeef757b (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.cpp | 34 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 14 |
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, |