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 | 44d6361ed76785b907992fda2639e55092a253cb (patch) | |
tree | 1988aa9e0266c5675a251bf69fbb158165514ca7 /clang/unittests/Lex | |
parent | 667f95395f27ec5a060ab67c19c5090e517b19ff (diff) | |
download | bcm5719-llvm-44d6361ed76785b907992fda2639e55092a253cb.tar.gz bcm5719-llvm-44d6361ed76785b907992fda2639e55092a253cb.zip |
Fix the handling of target options in our unit tests.
llvm-svn: 166079
Diffstat (limited to 'clang/unittests/Lex')
-rw-r--r-- | clang/unittests/Lex/LexerTest.cpp | 10 | ||||
-rw-r--r-- | clang/unittests/Lex/PreprocessingRecordTest.cpp | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp index e43ad86ff59..069b3ccff98 100644 --- a/clang/unittests/Lex/LexerTest.cpp +++ b/clang/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/clang/unittests/Lex/PreprocessingRecordTest.cpp b/clang/unittests/Lex/PreprocessingRecordTest.cpp index 5b5d933d1b1..e9898cabfee 100644 --- a/clang/unittests/Lex/PreprocessingRecordTest.cpp +++ b/clang/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; }; |