mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILModule lookup: now with that magic O(1) flavor.
Swift SVN r11978
This commit is contained in:
@@ -111,8 +111,11 @@ private:
|
||||
/// FIXME: Remove this when SILGlobalVariable is ready.
|
||||
llvm::SetVector<VarDecl*> globals;
|
||||
|
||||
/// Lookup cache for SIL functions.
|
||||
llvm::StringMap<SILFunction*> FunctionLookupCache;
|
||||
/// Lookup table for SIL functions.
|
||||
llvm::StringMap<SILFunction*> FunctionTable;
|
||||
|
||||
/// Lookup table for SIL global variables.
|
||||
llvm::StringMap<SILGlobalVariable*> GlobalVariableTable;
|
||||
|
||||
/// Lookup cache for SIL witness tables.
|
||||
llvm::DenseMap<const NormalProtocolConformance*,SILWitnessTable*>
|
||||
@@ -254,7 +257,19 @@ public:
|
||||
return {silGlobals.begin(), silGlobals.end()};
|
||||
}
|
||||
|
||||
SILFunction *lookup(StringRef Name);
|
||||
/// Look for a global variable by name.
|
||||
///
|
||||
/// \return null if this module has no such global variable
|
||||
SILGlobalVariable *lookUpGlobalVariable(StringRef name) {
|
||||
return GlobalVariableTable.lookup(name);
|
||||
}
|
||||
|
||||
/// Look for a function by name.
|
||||
///
|
||||
/// \return null if this module has no such function
|
||||
SILFunction *lookUpFunction(StringRef name) {
|
||||
return FunctionTable.lookup(name);
|
||||
}
|
||||
|
||||
/// \brief Return the declaration of a utility function that can,
|
||||
/// but needn't, be shared between modules.
|
||||
|
||||
Reference in New Issue
Block a user