 
   /// The message should use storage.
   static let useStorage =
-    AnalyseResult(usesStorage: true, costAsField: FieldCost.singleMessageFieldUsingStorage)
+    AnalyzeResult(usesStorage: true, costAsField: FieldCost.singleMessageFieldUsingStorage)
 }
 
-/// Cache for the `analyse(descriptor:)` results to avoid doing them multiple
+/// Cache for the `analyze(descriptor:)` results to avoid doing them multiple
 /// times.
-fileprivate var analysisCache: Dictionary<String,AnalyseResult> = [
+fileprivate var analysisCache: Dictionary<String,AnalyzeResult> = [
   // google.protobuf.Any can be seeded.
   ".google.protobuf.Any": .useStorage,
 ]
 
-/// Analyse the given descriptor to decide if it should use storage and what
+/// Analyze the given descriptor to decide if it should use storage and what
 /// the cost of it will be when appearing as a single field in another message.
-fileprivate func analyse(descriptor: Descriptor) -> AnalyseResult {
+fileprivate func analyze(descriptor: Descriptor) -> AnalyzeResult {
   if let analysis = analysisCache[descriptor.fullName] {
     return analysis
   }


/// The result of analysis, if the message should use heap storage and the
/// cost of the message when used as a field in other messages.
fileprivate struct AnalyseResult {
  let usesStorage: Bool
  let costAsField: Int


enum MessageStorageDecision {
  /// Compute if a message should use heap based sortage or not.
  static func shouldUseHeapStorage(descriptor: Descriptor) -> Bool {
    return analyze(descriptor: descriptor).usesStorage
  }
}
