[llvm] 0314dff - [DebugInfo] Delete unused DwarfUnit::addConstantFPValue & addConstantValue overloads. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 4 00:06:04 PST 2020
Author: Fangrui Song
Date: 2020-11-04T00:05:57-08:00
New Revision: 0314dff051848bae3d929e11207b2a0acfa41254
URL: https://github.com/llvm/llvm-project/commit/0314dff051848bae3d929e11207b2a0acfa41254
DIFF: https://github.com/llvm/llvm-project/commit/0314dff051848bae3d929e11207b2a0acfa41254.diff
LOG: [DebugInfo] Delete unused DwarfUnit::addConstantFPValue & addConstantValue overloads. NFC
This functions appear to be unused for many years.
Added:
Modified:
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 6208b5f2777f..082fffbb9a08 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -434,28 +434,6 @@ void DwarfUnit::addSourceLine(DIE &Die, const DIObjCProperty *Ty) {
addSourceLine(Die, Ty->getLine(), Ty->getFile());
}
-void DwarfUnit::addConstantFPValue(DIE &Die, const MachineOperand &MO) {
- assert(MO.isFPImm() && "Invalid machine operand!");
- DIEBlock *Block = new (DIEValueAllocator) DIEBlock;
- APFloat FPImm = MO.getFPImm()->getValueAPF();
-
- // Get the raw data form of the floating point.
- const APInt FltVal = FPImm.bitcastToAPInt();
- const char *FltPtr = (const char *)FltVal.getRawData();
-
- int NumBytes = FltVal.getBitWidth() / 8; // 8 bits per byte.
- bool LittleEndian = Asm->getDataLayout().isLittleEndian();
- int Incr = (LittleEndian ? 1 : -1);
- int Start = (LittleEndian ? 0 : NumBytes - 1);
- int Stop = (LittleEndian ? NumBytes : -1);
-
- // Output the constant to DWARF one byte at a time.
- for (; Start != Stop; Start += Incr)
- addUInt(*Block, dwarf::DW_FORM_data1, (unsigned char)0xFF & FltPtr[Start]);
-
- addBlock(Die, dwarf::DW_AT_const_value, Block);
-}
-
void DwarfUnit::addConstantFPValue(DIE &Die, const ConstantFP *CFP) {
// Pass this down to addConstantValue as an unsigned bag of bits.
addConstantValue(Die, CFP->getValueAPF().bitcastToAPInt(), true);
@@ -466,13 +444,6 @@ void DwarfUnit::addConstantValue(DIE &Die, const ConstantInt *CI,
addConstantValue(Die, CI->getValue(), Ty);
}
-void DwarfUnit::addConstantValue(DIE &Die, const MachineOperand &MO,
- const DIType *Ty) {
- assert(MO.isImm() && "Invalid machine operand!");
-
- addConstantValue(Die, DD->isUnsignedDIType(Ty), MO.getImm());
-}
-
void DwarfUnit::addConstantValue(DIE &Die, uint64_t Val, const DIType *Ty) {
addConstantValue(Die, DD->isUnsignedDIType(Ty), Val);
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 9751506e9fb3..5c643760fd56 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -190,7 +190,6 @@ class DwarfUnit : public DIEUnit {
void addSourceLine(DIE &Die, const DIObjCProperty *Ty);
/// Add constant value entry in variable DIE.
- void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty);
void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty);
void addConstantValue(DIE &Die, const APInt &Val, const DIType *Ty);
void addConstantValue(DIE &Die, const APInt &Val, bool Unsigned);
@@ -198,7 +197,6 @@ class DwarfUnit : public DIEUnit {
void addConstantValue(DIE &Die, bool Unsigned, uint64_t Val);
/// Add constant value entry in variable DIE.
- void addConstantFPValue(DIE &Die, const MachineOperand &MO);
void addConstantFPValue(DIE &Die, const ConstantFP *CFP);
/// Add a linkage name, if it isn't empty.
More information about the llvm-commits
mailing list