]> granicus.if.org Git - clang/commitdiff
Make ModuleMapParser own its TargetInfo, so it doesn't get leaked.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 29 Mar 2012 14:07:03 +0000 (14:07 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 29 Mar 2012 14:07:03 +0000 (14:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153648 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/ModuleMap.cpp

index e6851afada51716799c97c3e4b6bb546f1cca928..5304311ef6190049d91fc7915cb649d6bf44eefa 100644 (file)
@@ -508,7 +508,7 @@ namespace clang {
     
     /// \brief Default target information, used only for string literal
     /// parsing.
-    TargetInfo *Target;
+    OwningPtr<TargetInfo> Target;
     
     /// \brief Stores string data for the various string literals referenced
     /// during parsing.
@@ -551,7 +551,7 @@ namespace clang {
     {
       TargetOptions TargetOpts;
       TargetOpts.Triple = llvm::sys::getDefaultTargetTriple();
-      Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts);
+      Target.reset(TargetInfo::CreateTargetInfo(Diags, TargetOpts));
       
       Tok.clear();
       consumeToken();