From: Daniel Dunbar Date: Mon, 30 Nov 2009 08:41:42 +0000 (+0000) Subject: clang -cc1: Fix initialization of PreprocessorOptions::TokenCache. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39ed0b6f258db653024125b58f6c60cbea8b7176;p=clang clang -cc1: Fix initialization of PreprocessorOptions::TokenCache. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90126 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/CC1Options.cpp b/lib/Driver/CC1Options.cpp index 010c6a521b..e5bbfbb6ff 100644 --- a/lib/Driver/CC1Options.cpp +++ b/lib/Driver/CC1Options.cpp @@ -609,7 +609,10 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args) { using namespace cc1options; Opts.ImplicitPCHInclude = getLastArgValue(Args, OPT_include_pch); Opts.ImplicitPTHInclude = getLastArgValue(Args, OPT_include_pth); - Opts.TokenCache = getLastArgValue(Args, OPT_token_cache); + if (const Arg *A = Args.getLastArg(OPT_token_cache)) + Opts.TokenCache = A->getValue(Args); + else + Opts.TokenCache = Opts.ImplicitPTHInclude; Opts.UsePredefines = !Args.hasArg(OPT_undef); // Add macros from the command line.