diff options
author | jasonliu <jasonliu.development@gmail.com> | 2020-12-02 18:46:58 +0000 |
---|---|---|
committer | jasonliu <jasonliu.development@gmail.com> | 2020-12-02 20:03:15 +0000 |
commit | 2c63e7604c87d97723919ca00d80ea38cddca8f9 (patch) | |
tree | 434ae258f78b653004f47ebbf2bf4fad13f88f63 /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | 70764c02e474504e2ebfb5b230a3b2ccdbedc5c2 (diff) | |
download | llvm-2c63e7604c87d97723919ca00d80ea38cddca8f9.zip llvm-2c63e7604c87d97723919ca00d80ea38cddca8f9.tar.gz llvm-2c63e7604c87d97723919ca00d80ea38cddca8f9.tar.bz2 |
[XCOFF][AIX] Alternative path in EHStreamer for platforms do not have uleb128 support
Summary:
Not all system assembler supports `.uleb128 label2 - label1` form.
When the target do not support this form, we have to take
alternative manual calculation to get the offsets from them.
Reviewed By: hubert.reinterpretcast
Diffierential Revision: https://reviews.llvm.org/D92058
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index eea0aee..087d5e3 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -20,6 +20,7 @@ #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Mangler.h" #include "llvm/IR/Module.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCStreamer.h" @@ -55,6 +56,15 @@ TargetLoweringObjectFile::~TargetLoweringObjectFile() { delete Mang; } +unsigned TargetLoweringObjectFile::getCallSiteEncoding() const { + // If target does not have LEB128 directives, we would need the + // call site encoding to be udata4 so that the alternative path + // for not having LEB128 directives could work. + if (!getContext().getAsmInfo()->hasLEB128Directives()) + return dwarf::DW_EH_PE_udata4; + return CallSiteEncoding; +} + static bool isNullOrUndef(const Constant *C) { // Check that the constant isn't all zeros or undefs. if (C->isNullValue() || isa<UndefValue>(C)) |