[PATCH] D98010: [XCOFF] [DWARF] set default DWARF version to 3
ChenZheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 4 23:37:37 PST 2021
shchenz created this revision.
shchenz added reviewers: jsji, hubert.reinterpretcast, jasonliu, PowerPC.
shchenz requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
We support DWARF for XCOFF in D95518 <https://reviews.llvm.org/D95518>.
In this patch, we set the default DWARF version to 3 because the latest AIX OS supports DWARF version 3.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98010
Files:
clang/lib/Driver/ToolChains/AIX.h
clang/test/CodeGen/dwarf-version.c
Index: clang/test/CodeGen/dwarf-version.c
===================================================================
--- clang/test/CodeGen/dwarf-version.c
+++ clang/test/CodeGen/dwarf-version.c
@@ -32,6 +32,17 @@
// Explicitly request both.
// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \
// RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
+// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
+// RUN: FileCheck %s --check-prefix=VER3
+// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \
+// RUN: FileCheck %s --check-prefix=VER2
+// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \
+// RUN: FileCheck %s --check-prefix=VER3
+// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \
+// RUN: FileCheck %s --check-prefix=VER4
+// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \
+// RUN: FileCheck %s --check-prefix=VER5
+
int main (void) {
return 0;
}
Index: clang/lib/Driver/ToolChains/AIX.h
===================================================================
--- clang/lib/Driver/ToolChains/AIX.h
+++ clang/lib/Driver/ToolChains/AIX.h
@@ -74,6 +74,9 @@
RuntimeLibType GetDefaultRuntimeLibType() const override;
+ // Set default DWARF version to 3 for now as latest AIX OS supports version 3.
+ unsigned GetDefaultDwarfVersion() const override { return 3; }
+
protected:
Tool *buildAssembler() const override;
Tool *buildLinker() const override;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98010.328402.patch
Type: text/x-patch
Size: 1558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210305/2bcc05e3/attachment.bin>
More information about the cfe-commits
mailing list