DebugInfo: Use enum instead of unsigned
authorEd Maste <emaste@freebsd.org>
Wed, 7 May 2014 12:49:08 +0000 (12:49 +0000)
committerEd Maste <emaste@freebsd.org>
Wed, 7 May 2014 12:49:08 +0000 (12:49 +0000)
This makes debuging DebugInfo generation with LLDB a little more pleasant.

Differential Revision: http://reviews.llvm.org/D3626

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208202 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DebugInfo.h

index 1b97f6254215ad1dcc46c7223cb7560dd0b05fb8..65e0a0625f70a683131e9430001809c133b9b10c 100644 (file)
@@ -427,7 +427,9 @@ class DICompileUnit : public DIScope {
 public:
   explicit DICompileUnit(const MDNode *N = nullptr) : DIScope(N) {}
 
-  unsigned getLanguage() const { return getUnsignedField(2); }
+  dwarf::SourceLanguage getLanguage() const {
+    return static_cast<dwarf::SourceLanguage>(getUnsignedField(2));
+  }
   StringRef getProducer() const { return getStringField(3); }
 
   bool isOptimized() const { return getUnsignedField(4) != 0; }