[PATCH] Use enums instead of unsigned where possible

Eric Christopher echristo at gmail.com
Tue May 6 14:51:13 PDT 2014


Go ahead and commit this too, you'll just want to commit them in close
proximity to avoid number of bots that hate you.

-eric

On Tue, May 6, 2014 at 2:17 PM, Ed Maste <emaste at freebsd.org> wrote:
> Add comment suggested by echristo
>
> It turns out I missed a related llvm change in the diff (included here)  - should I put it in a separate LLVM review?  (Or put the cast in CGDebugInfo.cpp?)
> --- a/include/llvm/DebugInfo.h
> +++ b/include/llvm/DebugInfo.h
> @@ -413,7 +413,9 @@ class DICompileUnit : public DIScope {
>  public:
>    explicit DICompileUnit(const MDNode *N = 0) : DIScope(N) {}
>
> -  unsigned getLanguage() const { return getUnsignedField(2); }
> +  llvm::dwarf::SourceLanguage getLanguage() const {
> +    return static_cast<llvm::dwarf::SourceLanguage>(getUnsignedField(2));
> +  }
>    StringRef getProducer() const { return getStringField(3); }
>
>    bool isOptimized() const { return getUnsignedField(4) != 0; }
>
> http://reviews.llvm.org/D3626
>
> Files:
>   lib/CodeGen/CGDebugInfo.cpp
>   lib/CodeGen/CGDebugInfo.h



More information about the cfe-commits mailing list