diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-17 00:11:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-17 00:11:35 +0000 |
commit | 07f8cf4ec3ffb6668b35e7b864354faa76167209 (patch) | |
tree | 6b4e93839df296434d5b767d35c3d086dc5b1905 /unittests/Lex | |
parent | 16de3db5bb059c5274e75a788581b8123c05762a (diff) |
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
Diffstat (limited to 'unittests/Lex')
-rw-r--r-- | unittests/Lex/LexerTest.cpp | 10 | ||||
-rw-r--r-- | unittests/Lex/PreprocessingRecordTest.cpp | 10 |
2 files changed, 12 insertions, 8 deletions
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<TargetOptions> TargetOpts; IntrusiveRefCntPtr<TargetInfo> 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<TargetOptions> TargetOpts; IntrusiveRefCntPtr<TargetInfo> Target; }; |