]> granicus.if.org Git - clang/commitdiff
Encode the module hash in base-36, to reduce the length of the strings a bit
authorDouglas Gregor <dgregor@apple.com>
Wed, 14 Sep 2011 15:55:12 +0000 (15:55 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 14 Sep 2011 15:55:12 +0000 (15:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp

index 6c47d7b11418e57c6626359f22a8e3460d848d6a..c594526ceaf52810072e03acc1c3a5f9eee1b8ec 100644 (file)
@@ -1991,8 +1991,12 @@ std::string CompilerInvocation::getModuleHash() const {
   Signature.add((unsigned)T.getOS(), 5);
   Signature.add((unsigned)T.getEnvironment(), 4);
 
+  // Extend the signature with preprocessor options.
+  Signature.add(getPreprocessorOpts().UsePredefines, 1);
+  Signature.add(getPreprocessorOpts().DetailedRecord, 1);
+  
   // We've generated the signature. Treat it as one large APInt that we'll
-  // encode as hex and return.
+  // encode in base-36 and return.
   Signature.flush();
-  return Signature.getAsInteger().toString(16, /*Signed=*/false);
+  return Signature.getAsInteger().toString(36, /*Signed=*/false);
 }