Generate a unique hash for a file based on its name and contents (if any).
| 3248 | |
| 3249 | // Generate a unique hash for a file based on its name and contents (if any). |
| 3250 | static uint64_t HashFile(const char *source_filename, const char *source) { |
| 3251 | uint64_t hash = 0; |
| 3252 | |
| 3253 | if (source_filename) |
| 3254 | hash = HashFnv1a<uint64_t>(StripPath(source_filename).c_str()); |
| 3255 | |
| 3256 | if (source && *source) hash ^= HashFnv1a<uint64_t>(source); |
| 3257 | |
| 3258 | return hash; |
| 3259 | } |
| 3260 | |
| 3261 | CheckedError Parser::DoParse(const char *source, const char **include_paths, |
| 3262 | const char *source_filename, |