llvm-project/llvm/lib/Support
Sam McCall 22555bafe9 [VFS] InMemoryFilesystem's UniqueIDs are a function of path and content.
This ensures that re-creating "the same" FS results in the same UIDs for files.
In turn, this means that creating a clang module (preamble) using one in-memory
filesystem and consuming it using another doesn't create duplicate FileEntrys
for files that are the same in both FSes.

It's tempting to give the creator control over the UIDs instead. However that
requires fiddly API changes, e.g. what should the UIDs of intermediate
directories be?
This change is more "magic" but seems safe given:
 - InMemoryFilesystem is used in testing more than production
 - comparing UIDs across filesystems is unusual
 - files with the same path and content are usually logically equivalent

(The usual reason for re-creating virtual filesystems rather than reusing them
is that typical use involves mutating their CWD and so is not threadsafe).

Differential Revision: https://reviews.llvm.org/D110711
2021-09-29 23:24:18 +02:00
..
Unix [Support] Implement getMainExecutable on Solaris 2021-09-07 22:56:10 +02:00
Windows [llvm] Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]] 2021-07-28 09:31:14 -07:00
AArch64TargetParser.cpp [AArch64] Add target features for Armv9-A Scalable Matrix Extension (SME) 2021-07-12 13:28:10 +00:00
ABIBreak.cpp
AMDGPUMetadata.cpp [AMDGPU] HSAMD::fromString - replace std::string arg with StringRef. NFCI. 2021-01-26 16:09:39 +00:00
APFixedPoint.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
APFloat.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
APInt.cpp [APInt] Add a concat method, use LLVM_UNLIKELY to help optimizer. 2021-09-13 22:02:54 -07:00
APSInt.cpp ADT: Fix that APSInt's string constructor claims it requires 5 bits to store a zero 2020-06-10 16:36:33 +02:00
ARMAttributeParser.cpp [ARMAttributeParser] Correctly parse and print Tag_THUMB_ISA_use=3 2020-11-28 12:28:22 -08:00
ARMBuildAttrs.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
ARMTargetParser.cpp [ARM] Remove getHWDivName (NFC) 2021-07-23 07:44:23 -07:00
ARMWinEH.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
Allocator.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
Atomic.cpp
AutoConvert.cpp [SystemZ][z/OS] Fix return values in AutoConversion functions 2021-05-05 09:43:14 -04:00
BinaryStreamError.cpp
BinaryStreamReader.cpp [Support] Convert BinaryStream class zoo to 64-bit offsets 2021-09-16 19:14:52 -04:00
BinaryStreamRef.cpp [Support] Convert BinaryStream class zoo to 64-bit offsets 2021-09-16 19:14:52 -04:00
BinaryStreamWriter.cpp [Support] Convert BinaryStream class zoo to 64-bit offsets 2021-09-16 19:14:52 -04:00
BlockFrequency.cpp
BranchProbability.cpp BranchProbability.cpp - add missing implicit cmath header dependency. NFCI. 2021-06-05 21:14:43 +01:00
BuryPointer.cpp Add LLVM_ATTRIBUTE_USED to fix problems which could be exposed by aggressive global pointer variable removal 2021-04-26 13:31:37 -07:00
CMakeLists.txt [llvm-readobj] Support dumping of MSP430 ELF attributes 2021-09-28 00:56:11 +03:00
COM.cpp
COPYRIGHT.regex
CRC.cpp [CMake] Simplify CMake handling for zlib 2020-08-11 20:22:11 -07:00
CachePruning.cpp [ThinLTO] Also prune Thin-* files from the ThinLTO cache 2021-01-19 14:43:49 +01:00
Chrono.cpp
CodeGenCoverage.cpp
CommandLine.cpp Reset all options in cl::ResetCommandLineParser() 2021-08-16 09:56:22 +02:00
Compression.cpp [CMake] Simplify CMake handling for zlib 2020-08-11 20:22:11 -07:00
ConvertUTF.cpp
ConvertUTFWrapper.cpp Reland "[Support][unittests] Enforce alignment in ConvertUTFTest" 2020-10-14 12:02:27 +02:00
CrashRecoveryContext.cpp [llvm] Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]] 2021-07-28 09:31:14 -07:00
DAGDeltaAlgorithm.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
DJB.cpp
DataExtractor.cpp [Support] Make DataExtractor error messages more clear 2020-06-02 12:57:51 +02:00
Debug.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
DebugCounter.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
DebugOptions.h Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
DeltaAlgorithm.cpp
DynamicLibrary.cpp [flang] Revert "PoC for Flang Driver Plugins" 2021-07-01 08:27:31 +00:00
ELFAttributeParser.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
ELFAttributes.cpp
Errno.cpp
Error.cpp [Support] Add a C-API function to create a StringError instance. 2020-10-19 01:59:04 -07:00
ErrorHandling.cpp Remove `-Wunused-result` and `-Wpedantic` warnings from GCC. NFC. 2020-12-02 10:53:59 -05:00
ExtensibleRTTI.cpp [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
FileCollector.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
FileOutputBuffer.cpp Support: Add move semantics to mapped_file_region 2021-04-09 17:56:26 -07:00
FileUtilities.cpp [Support] Remove redundant calls to str() and c_str() (NFC) 2021-08-29 09:14:48 -07:00
FoldingSet.cpp [Support] FoldingSetNodeID::AddString(): reserve memory 2020-06-08 23:26:54 +03:00
FormatVariadic.cpp [NFC] Simplify `splitLiteralAndReplacement` function 2020-07-22 15:32:32 -07:00
FormattedStream.cpp [Support] Fix signed/unsigned comparison warning 2020-07-08 11:26:10 +01:00
GlobPattern.cpp Revert rGca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee "GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC" 2020-05-17 18:51:21 +01:00
GraphWriter.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
Hashing.cpp
Host.cpp [X86] Add CRC32 feature. 2021-09-06 17:24:30 +08:00
InitLLVM.cpp [InitLLVM] Ensure SIGPIPE handler installed before sigaction() 2021-01-08 15:13:04 -08:00
InstructionCost.cpp [Support] Introduce a new InstructionCost class 2020-12-11 08:12:54 +00:00
IntEqClasses.cpp
IntervalMap.cpp
ItaniumManglingCanonicalizer.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
JSON.cpp ADT: Stop peeking inside AlignedCharArrayUnion, NFC 2020-12-04 11:07:42 -08:00
KnownBits.cpp [KnownBits] Add support for X*X self-multiplication 2021-09-07 11:43:45 +01:00
LEB128.cpp
LineIterator.cpp Support: Allow use of MemoryBufferRef with line_iterator 2020-10-13 16:43:49 -04:00
Locale.cpp
LockFileManager.cpp [libc++] Remove unused macro in __config 2021-09-23 13:09:32 -04:00
LowLevelType.cpp Add support for zero-sized Scalars as a LowLevelType 2021-07-22 13:47:19 +02:00
MD5.cpp [Support] Update `MD5` to follow other hashes. 2021-08-19 14:13:14 -07:00
MSP430AttributeParser.cpp [llvm-readobj] Support dumping of MSP430 ELF attributes 2021-09-28 00:56:11 +03:00
MSP430Attributes.cpp [llvm-readobj] Support dumping of MSP430 ELF attributes 2021-09-28 00:56:11 +03:00
ManagedStatic.cpp Fix for memory leak reported by Valgrind 2021-03-16 11:01:31 -07:00
MathExtras.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
MemAlloc.cpp
Memory.cpp
MemoryBuffer.cpp [SystemZ][z/OS] Add the functions needed for handling EBCDIC I/O 2021-05-03 08:52:38 -04:00
MemoryBufferRef.cpp Support: Add operator== for MemoryBufferRef and split out MemoryBufferRef.h 2020-10-13 16:42:24 -04:00
NativeFormatting.cpp NativeFormatting.cpp - add missing implicit MathExtras.h header dependency. NFCI. 2021-06-05 18:05:39 +01:00
OptimizedStructLayout.cpp Fix a bug in OptimizedStructLayout when filling gaps before 2021-07-21 15:47:18 -04:00
Optional.cpp
Parallel.cpp [Support] Attempt to fix deadlock in ThreadGroup 2021-09-18 13:49:10 -04:00
Path.cpp [SystemZ][z/OS] Pass OpenFlags when creating tmp files 2021-06-08 14:45:34 -04:00
PluginLoader.cpp
PrettyStackTrace.cpp [Support] Add some missing namespace closure comments. NFCI. 2021-01-28 11:21:35 +00:00
Process.cpp [llvm] Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]] 2021-07-28 09:31:14 -07:00
Program.cpp Re-land [Support] On Windows, take the affinity mask into account 2021-01-14 17:03:22 -05:00
RISCVAttributeParser.cpp
RISCVAttributes.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
RWMutex.cpp
RandomNumberGenerator.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
Regex.cpp [ASTMatchers] Enhanced support for matchers taking Regex arguments 2020-07-02 14:52:25 +01:00
SHA1.cpp [llvm] Use static_assert instead of assert (NFC) 2021-01-22 23:25:05 -08:00
SHA256.cpp [Support] Use static_assert instead of assert (NFC) 2021-02-18 22:46:41 -08:00
ScaledNumber.cpp
ScopedPrinter.cpp [Support] Drop unnecessary const from return types (NFC) 2021-02-03 20:41:16 -08:00
Signals.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
Signposts.cpp [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
SmallPtrSet.cpp [ADT] Move DenseMapInfo for ArrayRef/StringRef into respective headers (NFC) 2021-06-03 18:34:36 +02:00
SmallVector.cpp [AIX] Suppress -Waix-compat warning with SmallVector class 2021-08-30 10:59:47 -04:00
SourceMgr.cpp [llvm] Use llvm::any_of (NFC) 2021-01-04 11:42:47 -08:00
SpecialCaseList.cpp [Support] Qualify auto (NFC) 2021-09-06 09:10:07 -07:00
Statistic.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
StringExtras.cpp [llvm] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
StringMap.cpp Revert "Use the default seed value for djb hash for StringMap" 2021-03-01 14:00:39 +01:00
StringRef.cpp [ADT] Rename StringRef case insensitive methods for clarity 2021-06-25 00:22:00 +03:00
StringSaver.cpp Temporarily Revert "[Support] Make UniqueStringSaver wrap a StringSet" 2020-05-14 19:18:20 -07:00
SuffixTree.cpp [SuffixTree][MachOpt] Factoring out Suffix Tree and adding Unit Tests 2020-06-08 12:44:18 -07:00
SymbolRemappingReader.cpp
SystemUtils.cpp [opt] Remove obsolete --quiet option 2020-07-08 13:21:20 -07:00
TarWriter.cpp
TargetParser.cpp [AMDGPU] Add gfx1035 target 2021-06-24 14:32:41 -04:00
TargetRegistry.cpp
ThreadLocal.cpp
ThreadPool.cpp Recommit: Support: add llvm::thread class that supports specifying stack size. 2021-07-08 16:22:26 +01:00
Threading.cpp [Support] reorder Threading includes to avoid conflict with FreeBSD headers 2021-07-09 10:39:52 +01:00
TimeProfiler.cpp [Support] Qualify auto (NFC) 2021-09-06 09:10:07 -07:00
Timer.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
ToolOutputFile.cpp [Windows] Remove global OF_None flag for Windows in ToolOutputFiles 2021-04-07 14:10:04 -04:00
TrigramIndex.cpp [Support] TrigramIndex::insert - pass std::String argument by const reference. NFCI. 2021-01-23 11:04:00 +00:00
Triple.cpp Temporarily revert the code part of D100981 "Delete le32/le64 targets" 2021-04-22 10:18:44 -07:00
Twine.cpp Consolidate string types into ptr and length representations. 2021-07-20 13:29:57 -07:00
TypeSize.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
Unicode.cpp Speedup some unicode rendering 2020-12-03 20:11:11 +01:00
UnicodeCaseFold.cpp
Valgrind.cpp Remove the NotUnderValgrind caching flag 2021-07-26 00:21:09 +00:00
VersionTuple.cpp VersionTuple.h - reduce includes to forward declarations. NFC. 2020-06-08 11:08:44 +01:00
VirtualFileSystem.cpp [VFS] InMemoryFilesystem's UniqueIDs are a function of path and content. 2021-09-29 23:24:18 +02:00
Watchdog.cpp
WithColor.cpp Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
X86TargetParser.cpp [X86] Add CRC32 feature. 2021-09-06 17:24:30 +08:00
YAMLParser.cpp [llvm] Use isAlpha/isAlnum (NFC) 2021-01-22 23:25:03 -08:00
YAMLTraits.cpp [YAML I/O] Fix bug in emission of empty sequence 2021-01-25 13:35:36 -08:00
Z3Solver.cpp [llvm][Z3][NFC] Improve mkBitvector performance 2020-06-30 12:26:50 +02:00
circular_raw_ostream.cpp
raw_os_ostream.cpp
raw_ostream.cpp [SystemZ][z/OS][Windows] Add new functions that set Text/Binary mode for Stdin and Stdout based on OpenFlags 2021-04-16 08:09:19 -04:00
regcomp.c
regengine.inc
regerror.c
regex2.h
regex_impl.h
regexec.c
regfree.c
regstrlcpy.c
regutils.h
xxhash.cpp