]> granicus.if.org Git - clang/commitdiff
clang -cc1: Fix initialization of PreprocessorOptions::TokenCache.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 30 Nov 2009 08:41:42 +0000 (08:41 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 30 Nov 2009 08:41:42 +0000 (08:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90126 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/CC1Options.cpp

index 010c6a521b5361b3577a5ed6ac46cbe58f8d53cb..e5bbfbb6ff7fb3b1025c8f2cf66a179f19fa8bfe 100644 (file)
@@ -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.