From 07f8cf4ec3ffb6668b35e7b864354faa76167209 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 17 Oct 2012 00:11:35 +0000 Subject: Fix the handling of target options in our unit tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166079 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Lex/LexerTest.cpp | 10 ++++++---- unittests/Lex/PreprocessingRecordTest.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'unittests/Lex') diff --git a/unittests/Lex/LexerTest.cpp b/unittests/Lex/LexerTest.cpp index e43ad86ff5..069b3ccff9 100644 --- a/unittests/Lex/LexerTest.cpp +++ b/unittests/Lex/LexerTest.cpp @@ -32,9 +32,11 @@ protected: : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), Diags(DiagID, new IgnoringDiagConsumer()), - SourceMgr(Diags, FileMgr) { - TargetOpts.Triple = "x86_64-apple-darwin11.1.0"; - Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts); + SourceMgr(Diags, FileMgr), + TargetOpts(new TargetOptions) + { + TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; + Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts); } FileSystemOptions FileMgrOpts; @@ -43,7 +45,7 @@ protected: DiagnosticsEngine Diags; SourceManager SourceMgr; LangOptions LangOpts; - TargetOptions TargetOpts; + IntrusiveRefCntPtr TargetOpts; IntrusiveRefCntPtr Target; }; diff --git a/unittests/Lex/PreprocessingRecordTest.cpp b/unittests/Lex/PreprocessingRecordTest.cpp index 5b5d933d1b..e9898cabfe 100644 --- a/unittests/Lex/PreprocessingRecordTest.cpp +++ b/unittests/Lex/PreprocessingRecordTest.cpp @@ -33,9 +33,11 @@ protected: : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), Diags(DiagID, new IgnoringDiagConsumer()), - SourceMgr(Diags, FileMgr) { - TargetOpts.Triple = "x86_64-apple-darwin11.1.0"; - Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts); + SourceMgr(Diags, FileMgr), + TargetOpts(new TargetOptions) + { + TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; + Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts); } FileSystemOptions FileMgrOpts; @@ -44,7 +46,7 @@ protected: DiagnosticsEngine Diags; SourceManager SourceMgr; LangOptions LangOpts; - TargetOptions TargetOpts; + IntrusiveRefCntPtr TargetOpts; IntrusiveRefCntPtr Target; }; -- cgit v1.2.3