llvm-project/llvm/lib/CodeGen/AsmPrinter
Nikita Popov fb7caa3c7b [AsmPrinter] Reject ptrtoint to larger size in lowerConstant()
When using a ptrtoint to a size larger than the pointer width in a
global initializer, we currently create a ptr & low_bit_mask style
MCExpr, which will later result in a relocation error during object
file emission.

This patch rejects the constant expression already during
lowerConstant(), which results in a much clearer error message
that references the constant expression at fault.

This fixes https://github.com/llvm/llvm-project/issues/56400,
for certain definitions of "fix".

Differential Revision: https://reviews.llvm.org/D130366
2022-07-25 10:18:27 +02:00
..
AIXException.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
ARMException.cpp [MC] De-capitalize MCStreamer functions 2022-06-07 00:31:02 -07:00
AccelTable.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
AddressPool.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
AddressPool.h
AsmPrinter.cpp [AsmPrinter] Reject ptrtoint to larger size in lowerConstant() 2022-07-25 10:18:27 +02:00
AsmPrinterDwarf.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
AsmPrinterInlineAsm.cpp [CodeGen] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC) 2022-03-20 23:11:06 -07:00
ByteStreamer.h [DwarfDebug] Restore code that make comments stay aligned in DwarfDebug::emitDebugLocEntry 2022-01-18 09:46:03 +01:00
CMakeLists.txt
CodeViewDebug.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
CodeViewDebug.h [CodeView] Combine variable def ranges that are continuous. 2022-05-20 12:12:14 -07:00
DIE.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
DIEHash.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
DIEHash.h DebugInfo: Don't hash DIE offsets before they're computed 2021-12-25 16:09:12 -08:00
DIEHashAttributes.def [DWARF] Add linkagename to hash 2022-07-08 10:15:25 -07:00
DbgEntityHistoryCalculator.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
DebugHandlerBase.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
DebugLocEntry.h [AsmPrinter] DebugLocEntry::dump() - Use const-ref iterator in for-range loop. NFCI. 2021-09-17 12:11:54 +01:00
DebugLocStream.cpp
DebugLocStream.h
DwarfCFIException.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
DwarfCompileUnit.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
DwarfCompileUnit.h Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
DwarfDebug.cpp [CodeGen] Qualify auto variables in for loops (NFC) 2022-07-17 01:33:28 -07:00
DwarfDebug.h DebugInfo: Don't allow type units to references types in the CU 2022-03-25 23:49:03 +00:00
DwarfException.h [CodeGen] Use default member initialization (NFC) 2022-01-30 12:32:51 -08:00
DwarfExpression.cpp [DWARF][FIX] Handle the use of multiple registers gracefully 2022-04-15 13:43:50 -05:00
DwarfExpression.h [DwarfDebug] Refuse to emit DW_OP_LLVM_arg values wider than 64 bits 2021-12-10 09:33:27 -08:00
DwarfFile.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
DwarfFile.h Revert "[DwarfDebug] Support emitting function-local declaration for a lexical block" & dependent patches 2021-12-24 00:47:04 +02:00
DwarfStringPool.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
DwarfStringPool.h
DwarfUnit.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00
DwarfUnit.h [CodeGen] Use default member initialization (NFC) 2022-01-30 12:32:51 -08:00
EHStreamer.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
EHStreamer.h
ErlangGCPrinter.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
OcamlGCPrinter.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
PseudoProbePrinter.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
PseudoProbePrinter.h [llvm] Remove unused forward declarations (NFC) 2022-01-07 20:00:34 -08:00
WasmException.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
WasmException.h [llvm] Remove redundaunt virtual specifiers (NFC) 2022-07-24 21:50:35 -07:00
WinCFGuard.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
WinCFGuard.h
WinException.cpp [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
WinException.h