[cfe-commits] [PATCH] use llvm::StringRef more

Douglas Gregor dgregor at apple.com
Tue Jun 21 08:13:40 PDT 2011


On Jun 21, 2011, at 7:35 AM, Jay Foad wrote:

> Make more use of llvm::StringRef in various APIs. In particular, the
> original motivation for this was to avoid using the deprecated forms
> of llvm::StringMap::GetOrCreateValue():
> 
>  // FIXME: Remove this method.
>  template <typename InitTy>
>  MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd,
>                               InitTy Val) {
>    return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val);
>  }
> 
>  // FIXME: Remove this method.
>  MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd) {
>    return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart));
>  }
> 
> Tested with "make check-all", LLVM and Clang. OK to commit?

Looks good, please go ahead!

	- Doug



More information about the cfe-commits mailing list