protected Enumeration(string name, int value) { Name = name; Value = value; ValueCache.Add(value, this); NameCache.Add(name, this); }
internal Value GetValueFor(LLVMValueRef valueRef, Func <LLVMValueRef, Value> constructor) { if (valueRef.Pointer == IntPtr.Zero) { throw new ArgumentNullException(nameof(valueRef)); } if (ValueCache.TryGetValue(valueRef.Pointer, out Value retVal)) { return(retVal); } retVal = constructor(valueRef); ValueCache.Add(valueRef.Pointer, retVal); return(retVal); }