mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 14:01:45 +00:00
IR: Use SmallVector instead of std::vector of TrackingMDRef
Don't use std::vector<TrackingMDRef>, since (at least in some versions of libc++) std::vector apparently copies values on grow operations instead of moving them. Found this when I was temporarily deleting the copy constructor for TrackingMDRef to investigate a performance bottleneck. llvm-svn: 266909
This commit is contained in:
1 parent
07320e4030
commit
3c406c2da5
3 files changed
+12
-3
No files matched your search
@@ -107,7 +107,12 @@ class BitcodeReaderMetadataList {
|
||||
bool AnyFwdRefs;
|
||||
unsigned MinFwdRef;
|
||||
unsigned MaxFwdRef;
|
||||
std::vector<TrackingMDRef> MetadataPtrs;
|
||||
|
||||
/// Array of metadata references.
|
||||
///
|
||||
/// Don't use std::vector here. Some versions of libc++ copy (instead of
|
||||
/// move) on resize, and TrackingMDRef is very expensive to copy.
|
||||
SmallVector<TrackingMDRef, 1> MetadataPtrs;
|
||||
|
||||
LLVMContext &Context;
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user