summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-28 01:44:40 +0000
committerChris Lattner <sabre@nondot.org>2009-03-28 01:44:40 +0000
commita6f4ca2b6ff423e4f72c84f357f613e124e95f59 (patch)
tree3814c0be443f68b16ad49978bb284e1879e2289f
parent84bcc4795e5bae96ae547421d8615471bbc87148 (diff)
downloadbcm5719-llvm-a6f4ca2b6ff423e4f72c84f357f613e124e95f59.tar.gz
bcm5719-llvm-a6f4ca2b6ff423e4f72c84f357f613e124e95f59.zip
remove TranslationUnit::OwnsDecls, which is only set, never read.
llvm-svn: 67891
-rw-r--r--clang/include/clang/AST/TranslationUnit.h8
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/lib/AST/TranslationUnit.cpp7
-rw-r--r--clang/tools/clang-cc/RewriteObjC.cpp1
4 files changed, 6 insertions, 13 deletions
diff --git a/clang/include/clang/AST/TranslationUnit.h b/clang/include/clang/AST/TranslationUnit.h
index 9c356a20fdf..33cb47b9e5e 100644
--- a/clang/include/clang/AST/TranslationUnit.h
+++ b/clang/include/clang/AST/TranslationUnit.h
@@ -33,17 +33,13 @@ class FileEntry;
class TranslationUnit {
ASTContext* Context;
bool OwnsMetaData;
- bool OwnsDecls;
// The default ctor is only invoked during deserialization.
- explicit TranslationUnit() : Context(NULL), OwnsMetaData(true),
- OwnsDecls(true) {}
+ explicit TranslationUnit() : Context(NULL), OwnsMetaData(true){}
public:
explicit TranslationUnit(ASTContext& Ctx)
- : Context(&Ctx), OwnsMetaData(false), OwnsDecls(true) {}
-
- void SetOwnsDecls(bool val) { OwnsDecls = val; }
+ : Context(&Ctx), OwnsMetaData(false) {}
~TranslationUnit();
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index da6e049732e..3fe6db83428 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -35,8 +35,7 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
bool FreeMem, unsigned size_reserve) :
GlobalNestedNameSpecifier(0), CFConstantStringTypeDecl(0),
ObjCFastEnumerationStateTypeDecl(0), SourceMgr(SM), LangOpts(LOpts),
- FreeMemory(FreeMem), Target(t), Idents(idents), Selectors(sels)
-{
+ FreeMemory(FreeMem), Target(t), Idents(idents), Selectors(sels) {
if (size_reserve > 0) Types.reserve(size_reserve);
InitBuiltinTypes();
BuiltinInfo.InitializeBuiltins(idents, Target, LangOpts.NoBuiltin);
diff --git a/clang/lib/AST/TranslationUnit.cpp b/clang/lib/AST/TranslationUnit.cpp
index 95cad39f681..ed84241df42 100644
--- a/clang/lib/AST/TranslationUnit.cpp
+++ b/clang/lib/AST/TranslationUnit.cpp
@@ -35,10 +35,9 @@ TranslationUnit::~TranslationUnit() {
// The ASTContext object has the sole references to the IdentifierTable
// Selectors, and the Target information. Go and delete them, since
// the TranslationUnit effectively owns them.
-
- delete &(Context->Idents);
- delete &(Context->Selectors);
- delete &(Context->Target);
+ delete &Context->Idents;
+ delete &Context->Selectors;
+ delete &Context->Target;
delete Context;
}
}
diff --git a/clang/tools/clang-cc/RewriteObjC.cpp b/clang/tools/clang-cc/RewriteObjC.cpp
index c3cc2c3852a..2ce983ca858 100644
--- a/clang/tools/clang-cc/RewriteObjC.cpp
+++ b/clang/tools/clang-cc/RewriteObjC.cpp
@@ -127,7 +127,6 @@ namespace {
virtual void Initialize(ASTContext &context);
virtual void InitializeTU(TranslationUnit &TU) {
- TU.SetOwnsDecls(false);
Initialize(TU.getContext());
}
OpenPOWER on IntegriCloud