From 79ba2a6379f87fa137377c3f55ff993b9e5cc144 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 22 Oct 2010 16:48:22 +0000 Subject: [PATCH] More class anonymization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117106 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprCXX.cpp | 2 ++ lib/CodeGen/CGExprScalar.cpp | 2 +- lib/CodeGen/CGRTTI.cpp | 14 ++++++++------ lib/Rewrite/FrontendActions.cpp | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index bc4059593f..478b95ae39 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -688,6 +688,7 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E, StoreAnyExprIntoOneUnit(CGF, E, NewPtr); } +namespace { /// A utility class for saving an rvalue. class SavedRValue { public: @@ -727,6 +728,7 @@ public: Kind getKind() const { return K; } llvm::Value *getValue() const { return Value; } }; +} // end anonymous namespace /// Given an r-value, perform the code necessary to make sure that a /// future RestoreRValue will be able to load the value without diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index ef12cd844c..f45cd164d4 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -39,6 +39,7 @@ using llvm::Value; // Scalar Expression Emitter //===----------------------------------------------------------------------===// +namespace { struct BinOpInfo { Value *LHS; Value *RHS; @@ -47,7 +48,6 @@ struct BinOpInfo { const Expr *E; // Entire expr, for error unsupported. May not be binop. }; -namespace { class ScalarExprEmitter : public StmtVisitor { CodeGenFunction &CGF; diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 60c3a5f84b..2659bd0821 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -695,12 +695,14 @@ void RTTIBuilder::BuildSIClassTypeInfo(const CXXRecordDecl *RD) { Fields.push_back(BaseTypeInfo); } -/// SeenBases - Contains virtual and non-virtual bases seen when traversing -/// a class hierarchy. -struct SeenBases { - llvm::SmallPtrSet NonVirtualBases; - llvm::SmallPtrSet VirtualBases; -}; +namespace { + /// SeenBases - Contains virtual and non-virtual bases seen when traversing + /// a class hierarchy. + struct SeenBases { + llvm::SmallPtrSet NonVirtualBases; + llvm::SmallPtrSet VirtualBases; + }; +} /// ComputeVMIClassTypeInfoFlags - Compute the value of the flags member in /// abi::__vmi_class_type_info. diff --git a/lib/Rewrite/FrontendActions.cpp b/lib/Rewrite/FrontendActions.cpp index 977e0cfba6..f8f1efa295 100644 --- a/lib/Rewrite/FrontendActions.cpp +++ b/lib/Rewrite/FrontendActions.cpp @@ -42,6 +42,7 @@ ASTConsumer *FixItAction::CreateASTConsumer(CompilerInstance &CI, return new ASTConsumer(); } +namespace { class FixItRewriteInPlace : public FixItOptions { public: std::string RewriteFilename(const std::string &Filename) { return Filename; } @@ -64,6 +65,7 @@ public: return Path.c_str(); } }; +} // end anonymous namespace bool FixItAction::BeginSourceFileAction(CompilerInstance &CI, llvm::StringRef Filename) { -- 2.40.0