1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

2915 Commits

Author SHA1 Message Date
Rafael Espindola
3630b71760 Store MCSymbols in PendingLabels.
llvm-svn: 238582
2015-05-29 17:41:59 +00:00
Rafael Espindola
7ec1caedd1 Move SymbolSize from MCSymbolData to MCSymbol.
llvm-svn: 238580
2015-05-29 17:24:52 +00:00
Pete Cooper
d797e8039e Fix crash in MCExpr::print.
Symbols are no longer required to be named, but this leads to a crash here if an
unnamed symbol checks that its first character is '$'.

Change the code to first check for a name, then check its first character.

No test case i'm afraid as this is debugging code, but any test case with temp labels
and 'llc --debug --filetype=obj' would have crashed.

llvm-svn: 238579
2015-05-29 17:19:11 +00:00
Reid Kleckner
8db67f8118 [WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86
Small (really small!) C++ exception handling examples work on 32-bit x86
now.

This change disables the use of .seh_* directives in WinException when
CFI is not in use. It also uses absolute symbol references in the tables
instead of imagerel32 relocations.

Also fixes a cache invalidation bug in MMI personality classification.

llvm-svn: 238575
2015-05-29 17:00:57 +00:00
Rafael Espindola
150d0a1719 Simplify now that symbols contain the correct section.
The complexity in here was because before r233995 variable symbols would report
the incorrect section.

llvm-svn: 238559
2015-05-29 15:07:27 +00:00
Rafael Espindola
2ea0919069 Fix ELFObjectWriter::isLocal for signature symbols.
And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.

No functionality change overall since the old code avoided the isLocal bug.

llvm-svn: 238555
2015-05-29 14:20:40 +00:00
Rafael Espindola
c79576b357 Don't special case undefined symbol when deciding the symbol order.
ELF has no restrictions on where undefined symbols go relative to other defined
symbols. In fact, gas just sorts them together. Do the same.

This was there since r111174 probably just because the MachO writer has it.

llvm-svn: 238513
2015-05-28 21:59:34 +00:00
Rafael Espindola
be6f69a9cc Remove a trivial forwarding function. NFC.
llvm-svn: 238506
2015-05-28 21:36:02 +00:00
Rafael Espindola
effa5fc7da Inline trivial method. NFC.
llvm-svn: 238492
2015-05-28 20:53:09 +00:00
Daniel Sanders
82a2ed16ac Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder.

llvm-svn: 238483
2015-05-28 20:30:32 +00:00
Rafael Espindola
2addfe8ca6 Remove structure field that can be computed just before use.
llvm-svn: 238480
2015-05-28 20:25:29 +00:00
Rafael Espindola
1b6358631c Avoid warnings when building without asserts.
llvm-svn: 238479
2015-05-28 20:19:31 +00:00
Rafael Espindola
7335e39983 Move these vectors to the only function where they are used.
llvm-svn: 238477
2015-05-28 20:11:34 +00:00
Rafael Espindola
b57f3b4cc5 Merge redundant loops. NFC.
llvm-svn: 238471
2015-05-28 20:00:13 +00:00
Rafael Espindola
2fdca8e81e Simplify LastLocalSymbolIndex computation. NFC.
llvm-svn: 238465
2015-05-28 19:46:36 +00:00
Rafael Espindola
341a6b15d6 Use range loops. NFC.
llvm-svn: 238463
2015-05-28 19:43:20 +00:00
Rafael Espindola
bb70fe86e9 Remove temporary FileSymbolData. NFC.
llvm-svn: 238461
2015-05-28 19:29:15 +00:00
Colin LeMahieu
b63fdb630a [llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
llvm-svn: 238453
2015-05-28 18:39:50 +00:00
Rafael Espindola
cea3662074 Use range loops for accessing file names. NFC.
llvm-svn: 238446
2015-05-28 18:03:20 +00:00
Rafael Espindola
7a39767414 Merge computeSymbolTable and writeSymbolTable.
For now this just saves a few loops, but it will allow more simplifications
in the future.

llvm-svn: 238444
2015-05-28 17:54:01 +00:00
Rafael Espindola
bde36f1a15 Don't create an unused _GLOBAL_OFFSET_TABLE_.
This was a bug for bug compatibility with gas that is completely unnecessary.
If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by
the time we get to the ELF writer.

llvm-svn: 238432
2015-05-28 15:20:00 +00:00
Daniel Sanders
bb2be43a35 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

Differential Revision: http://reviews.llvm.org/D9669

llvm-svn: 238427
2015-05-28 14:52:15 +00:00
Benjamin Kramer
2f0759b0f8 [MC] Replace custom string join function with the one from StringExtras.
NFC.

llvm-svn: 238414
2015-05-28 11:45:32 +00:00
Benjamin Kramer
5a56e44e39 Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.

llvm-svn: 238412
2015-05-28 11:24:24 +00:00
Rafael Espindola
503facf5b4 Rename and move getCurrentSectionData.
I think this concludes the merge of MCSectionData and MCSection.

llvm-svn: 238358
2015-05-27 21:04:14 +00:00
Rafael Espindola
8fe72c8025 There is only one current section.
Both MCStreamer and MCObjectStreamer were maintaining a current section
variable and they were slightly out of sync. I don't think this was observable,
but was inefficient and error prone.

Changing this requires a few cascading changes:

* SwitchSection has to call ChangeSection earlier for ChangeSection to see
  the old section.
* With that change, ChangeSection cannot call EmitLabel, since during
  ChangeSection we are still in the old section.
* When the object streamer requires a begin label, just reused the existing
  generic support for begin labels instead of calling EmitLabel directly.

llvm-svn: 238357
2015-05-27 20:52:32 +00:00
Rafael Espindola
d6d3f0f178 Fix NDEBUG build.
llvm-svn: 238332
2015-05-27 15:18:34 +00:00
Rafael Espindola
5bd1e1acf7 Delete MCSectionData.
llvm-svn: 238331
2015-05-27 15:14:11 +00:00
Rafael Espindola
bb6cd41e1d Delete dead code. NFC.
llvm-svn: 238330
2015-05-27 14:55:09 +00:00
Rafael Espindola
2e703bbc6f Stop using MCSectionData in WinCOFFObjectWriter.cpp.
llvm-svn: 238329
2015-05-27 14:45:54 +00:00
Rafael Espindola
936fe6368a clang-format WinCOFFObjectWriter.cpp. NFC.
llvm-svn: 238328
2015-05-27 14:37:12 +00:00
Rafael Espindola
5d6089681f Remove uses of MCSectionData from MachObjectWriter.cpp.
llvm-svn: 238327
2015-05-27 14:33:39 +00:00
Rafael Espindola
f4c2c46fb8 Move getSubsectionInsertionPoint to MCSection.
llvm-svn: 238320
2015-05-27 13:37:28 +00:00
Rafael Espindola
687afbf70a Remove uses of MCSectionData from ELFObjectWriter. NFC.
llvm-svn: 238317
2015-05-27 13:30:50 +00:00
Rafael Espindola
2ada7efad8 Use operator<< instead of print in a few more places.
llvm-svn: 238315
2015-05-27 13:05:42 +00:00
Rafael Espindola
08a1350b50 We always have an InstPrinter.
llvm-svn: 238311
2015-05-27 12:13:06 +00:00
Daniel Sanders
4dc3da5c0b Revert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
This broke the llvm-mips-linux builder and several of our out-of-tree builders.
Initial investigations show that the commit probably isn't the problem but
reverting anyway while I investigate.

llvm-svn: 238302
2015-05-27 08:44:01 +00:00
Matthias Braun
3c24983b23 MCSymbol: Make print() robust against empty names
This shouldn't happen, but it's nice not to abort when printing broken machine
functions.

llvm-svn: 238287
2015-05-27 05:12:37 +00:00
Rafael Espindola
0e92f19a7e Replace getOrCreateSectionData with registerSection.
There is now no SectionData to be created.

llvm-svn: 238208
2015-05-26 15:07:25 +00:00
Rafael Espindola
1c87cbde41 Have getCurrentSectionData return a MCSection.
I will fix the name shortly.

llvm-svn: 238204
2015-05-26 14:48:11 +00:00
Rafael Espindola
e67d49ec65 Pass a MCSection to getCurrentSectionData.
A step towards merging MCSection and MCSectionData.

llvm-svn: 238203
2015-05-26 14:42:52 +00:00
Michael Kuperstein
9b9d97f26a Use std::bitset for SubtargetFeatures.
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first several times this was committed (e.g. r229831, r233055), it caused several buildbot failures.
Apparently the reason for most failures was both clang and gcc's inability to deal with large numbers (> 10K) of bitset constructor calls in tablegen-generated initializers of instruction info tables. 
This should now be fixed.

llvm-svn: 238192
2015-05-26 10:47:10 +00:00
Daniel Sanders
adc4fb19a2 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

This commit uses DW_EH_PE_sdata8 for N64 as far as is possible at the moment.
However, it is possible to end up with DW_EH_PE_sdata4 when a TargetMachine is
not available. There's no risk of issues with inconsistency here since the
tables are self describing but it does mean there is a small chance of the
PC-relative offset being out of range for particularly large programs.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

Differential Revision: http://reviews.llvm.org/D9669

llvm-svn: 238190
2015-05-26 10:19:18 +00:00
Rafael Espindola
e78e9457dc Remove most uses of MCSectionData from MCAssembler.
llvm-svn: 238172
2015-05-26 02:17:21 +00:00
Rafael Espindola
73c4e75193 Stop using MCSectionData in MCAsmLayout.h.
llvm-svn: 238170
2015-05-26 02:00:36 +00:00
Rafael Espindola
54231e91c6 Move MCSection destruction to MCContext::reset.
Fixes the leaks when running llc.

Also found by an asan bot.

llvm-svn: 238167
2015-05-26 01:52:19 +00:00
Rafael Espindola
4f9f9a1d0f Stop using MCSectionData in MCMachObjectWriter.h.
llvm-svn: 238165
2015-05-26 01:15:30 +00:00
Rafael Espindola
0173a2073d Stop using MCSectionData in MCExpr.h.
llvm-svn: 238163
2015-05-26 00:52:18 +00:00
Rafael Espindola
aea8a3a003 Return a MCSection from MCFragment::getParent().
Another step in merging MCSectionData and MCSection.

llvm-svn: 238162
2015-05-26 00:36:57 +00:00
Rafael Espindola
4542f2778f Call the destructors of the MCSections.
They now contain the fragments. If we don't call the destructors the
fragments leak.

Found by an asan bot.

llvm-svn: 238161
2015-05-26 00:32:28 +00:00