[PATCH] D19072: [CodeGen] Split CGDebugInfo into CGDebugInfo and CGDebugDwarf

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 18 12:53:54 PDT 2016


aprantl added inline comments.

================
Comment at: lib/CodeGen/CGDebugInfo.h:97
@@ -273,3 +96,3 @@
   /// Set the main CU's DwoId field to \p Signature.
-  void setDwoId(uint64_t Signature);
+  virtual void setDwoId(uint64_t Signature) = 0;
 
----------------
Why does this need to be virtual?

================
Comment at: lib/CodeGen/CGDebugInfo.h:298
@@ +297,3 @@
+  virtual llvm::DISubroutineType *
+  getOrCreateFunctionType(const Decl *D, QualType FnType, llvm::DIFile *F) = 0;
+
----------------
As you said, this isn't very clean. Can you outline how this can be improved later? Will CodeView still need some form of DISubroutineTypes?

================
Comment at: lib/CodeGen/CGDebugInfo.h:348
@@ -493,1 +347,3 @@
+  virtual llvm::DIType *EmitTypeForVarWithBlocksAttr(const VarDecl *VD,
+                                                     uint64_t *OffSet) = 0;
 
----------------
Should this be part of CGDebugInfoDwarf?

================
Comment at: lib/CodeGen/CGDebugInfo.h:350
@@ -493,4 +349,3 @@
 
-  /// Get the vtable name for the given class.
-  StringRef getVTableName(const CXXRecordDecl *Decl);
+  virtual void retainType(void *OpaqueDecl) {};
 
----------------
1. Why does retainType need to be virtual?
2. I assume that the list of retained types is meaningless for CodeView? Could this be moved to CGDebugInfoDwarf instead?

================
Comment at: lib/CodeGen/CGDebugInfo.h:354
@@ -500,5 +353,3 @@
 
-  /// Get column number for the location. If location is
-  /// invalid then use current location.
-  /// \param Force  Assume DebugColumnInfo option is true.
-  unsigned getColumnNumber(SourceLocation Loc, bool Force = false);
+private:
+  /// Create new compile unit.
----------------
redundant private.


http://reviews.llvm.org/D19072





More information about the cfe-commits mailing list