Using the enum types makes debugging this code w/ LLDB a little more pleasant
Details
Diff Detail
Event Timeline
Might want add a comment above EmitDeclare about the custom tag which is why we can't use llvm::dwarf::Tag.
Otherwise lgtm.
-eric
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; }
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