aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ConstantPools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-02-14[MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex}Fangrui Song1-1/+1
2020-02-14[MC] De-capitalize another set of MCStreamer::Emit* functionsFangrui Song1-2/+2
Emit{ValueTo,Code}Alignment Emit{DTP,TP,GP}* EmitSymbolValue etc
2020-02-14[MC] De-capitalize some MCStreamer::Emit* functionsFangrui Song1-2/+2
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-09-03[MC] - ConstantPools.cpp: Style consistency, remove redundant braces. NFC.Kristina Brooks1-4/+2
Remove braces around two, single statement "if" blocks in line with rest of the file and the general LLVM code style. NFC, testing commit access. llvm-svn: 341294
2017-05-22Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg ↵James Molloy1-0/+11
directives Re-applying now that PR32825 which was raised on the commit this fixed up is now known to have also been fixed by this commit. Original commit message: Multiple ldr pseudoinstructions with the same constant value will reuse the same constant pool entry. However, if the constant pool is explicitly flushed with a .ltorg directive, we should not try to reference constants in the previous pool any longer, since they may be out of range. This fixes assembling hand-written assembler source which repeatedly loads the same constant value, across a binary size larger than the pc-relative fixup range for ldr instructions (4096 bytes). Such assembler source already uses explicit .ltorg instructions to emit constant pools with regular intervals. However if we try to reuse constants emitted in earlier pools, they end up out of range. This makes the output of the testcase match what binutils gas does (prior to this patch, it would fail to assemble). Differential Revision: https://reviews.llvm.org/D32847 llvm-svn: 303540
2017-05-22Re-apply r286006: Fix 24560: assembler does not share constant pool for ↵James Molloy1-1/+11
same constants Re-applying now that the open bug on this commit, PR32825, is known to be fixed. Original commit message: Summary: This patch returns the same label if the CP entry with the same value has been created. Reviewers: eli.friedman, rengolin, jmolloy Subscribers: majnemer, jmolloy, llvm-commits Differential Revision: https://reviews.llvm.org/D25804 llvm-svn: 303539
2017-05-22Revert "[ARM] Clear the constant pool cache on explicit .ltorg directives"James Molloy1-11/+0
This reverts commit r302416. This was a fixup for r286006, which has now been reverted so this doesn't apply (either in concept or in code). This commit itself has no problems, but the underlying issue it was fixing has now disappeared from the codebase. llvm-svn: 303536
2017-05-22Revert "Fix 24560: assembler does not share constant pool for same constants"James Molloy1-11/+1
This reverts commit r286006. It caused PR32825 and wasn't fixed. llvm-svn: 303535
2017-05-08[ARM] Clear the constant pool cache on explicit .ltorg directivesMartin Storsjo1-0/+11
Multiple ldr pseudoinstructions with the same constant value will reuse the same constant pool entry. However, if the constant pool is explicitly flushed with a .ltorg directive, we should not try to reference constants in the previous pool any longer, since they may be out of range. This fixes assembling hand-written assembler source which repeatedly loads the same constant value, across a binary size larger than the pc-relative fixup range for ldr instructions (4096 bytes). Such assembler source already uses explicit .ltorg instructions to emit constant pools with regular intervals. However if we try to reuse constants emitted in earlier pools, they end up out of range. This makes the output of the testcase match what binutils gas does (prior to this patch, it would fail to assemble). Differential Revision: https://reviews.llvm.org/D32847 llvm-svn: 302416
2017-02-07[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko1-2/+5
minor fixes (NFC). llvm-svn: 294369
2016-11-04Fix 24560: assembler does not share constant pool for same constantsWeiming Zhao1-1/+11
Summary: This patch returns the same label if the CP entry with the same value has been created. Reviewers: eli.friedman, rengolin, jmolloy Subscribers: majnemer, jmolloy, llvm-commits Differential Revision: https://reviews.llvm.org/D25804 llvm-svn: 286006
2016-10-14Tidy the calls to getCurrentSection().first -> getCurrentSectionOnly to helpEric Christopher1-2/+2
readability a bit. llvm-svn: 284202
2016-06-26Apply clang-tidy's modernize-loop-convert to lib/MC.Benjamin Kramer1-10/+7
Only minor manual fixes. No functionality change intended. llvm-svn: 273814
2015-11-16[ARM,AArch64] Store source location of asm constant pool entriesOliver Stannard1-5/+5
Storing the source location of the expression that created a constant pool entry allows us to emit better error messages if we later discover that the expression cannot be represented by a relocation. Differential Revision: http://reviews.llvm.org/D14646 llvm-svn: 253220
2015-05-30MC: Clean up MCExpr naming. NFC.Jim Grosbach1-1/+1
llvm-svn: 238634
2015-05-21Move alignment from MCSectionData to MCSection.Rafael Espindola1-7/+6
This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
2015-05-18MC: Clean up method names in MCContext.Jim Grosbach1-1/+1
The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
2015-01-14[cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth1-1/+1
utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
2014-07-18Fix build failure on windowsDavid Peixotto1-1/+1
Add explicit constructor to struct instead of using brace initialization. llvm-svn: 213389
2014-07-18MC: support different sized constants in constant poolsDavid Peixotto1-7/+10
On AArch64 the pseudo instruction ldr <reg>, =... supports both 32-bit and 64-bit constants. Add support for 64 bit constants for the pools to support the pseudo instruction fully. Changes the AArch64 ldr-pseudo tests to use 32-bit registers and adds tests with 64-bit registers. Patch by Janne Grunau! Differential Revision: http://reviews.llvm.org/D4279 llvm-svn: 213387
2014-06-18[ARM] [MC] Refactor the constant pool classesWeiming Zhao1-0/+95
ARMTargetStreamer implements ConstantPool and AssmeblerConstantPools to keep track of assembler-generated constant pools that are used for ldr-pseudo. When implementing ldr-pseudo for AArch64, these two classes can be reused. So this patch factors them out from ARM target to the general MC lib. llvm-svn: 211198