[PATCH] D69393: [RFC][DebugInfo] emit user specified address_space in dwarf

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 23:12:02 PDT 2019


yonghong-song updated this revision to Diff 227400.
yonghong-song edited the summary of this revision.
yonghong-song added a comment.

minor update to only support address_space 1 for user pointer


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69393/new/

https://reviews.llvm.org/D69393

Files:
  clang/lib/Basic/Targets/BPF.h
  clang/lib/Basic/Targets/X86.h


Index: clang/lib/Basic/Targets/X86.h
===================================================================
--- clang/lib/Basic/Targets/X86.h
+++ clang/lib/Basic/Targets/X86.h
@@ -45,6 +45,10 @@
     AMD3DNowAthlon
   } MMX3DNowLevel = NoMMX3DNow;
   enum XOPEnum { NoXOP, SSE4A, FMA4, XOP } XOPLevel = NoXOP;
+  enum Address {
+    Generic = 0,
+    OsUser = 1,
+  };
 
   bool HasAES = false;
   bool HasVAES = false;
@@ -257,6 +261,14 @@
     setFeatureEnabledImpl(Features, Name, Enabled);
   }
 
+  Optional<unsigned>
+  getDWARFAddressSpace(unsigned AddressSpace) const override {
+    const unsigned DWARF_OsUser = 1;
+    if (AddressSpace == OsUser)
+      return DWARF_OsUser;
+    return None;
+  }
+
   // This exists purely to cut down on the number of virtual calls in
   // initFeatureMap which calls this repeatedly.
   static void setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
Index: clang/lib/Basic/Targets/BPF.h
===================================================================
--- clang/lib/Basic/Targets/BPF.h
+++ clang/lib/Basic/Targets/BPF.h
@@ -24,6 +24,11 @@
 class LLVM_LIBRARY_VISIBILITY BPFTargetInfo : public TargetInfo {
   static const Builtin::Info BuiltinInfo[];
 
+  enum Address {
+    Generic = 0,
+    OsUser = 1,
+  };
+
 public:
   BPFTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
       : TargetInfo(Triple) {
@@ -58,6 +63,14 @@
 
   ArrayRef<Builtin::Info> getTargetBuiltins() const override;
 
+  Optional<unsigned>
+  getDWARFAddressSpace(unsigned AddressSpace) const override {
+    const unsigned DWARF_OsUser = 1;
+    if (AddressSpace == OsUser)
+      return DWARF_OsUser;
+    return None;
+  }
+
   const char *getClobbers() const override { return ""; }
 
   BuiltinVaListKind getBuiltinVaListKind() const override {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69393.227400.patch
Type: text/x-patch
Size: 1791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191101/a7e3875a/attachment.bin>


More information about the cfe-commits mailing list