1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

100 Commits

Author SHA1 Message Date
Chris Lattner
0ebcc18dec the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.

llvm-svn: 114817
2010-09-27 06:44:54 +00:00
Dan Gohman
0b5b93b20d Eliminate unnecessary uses of getZExtValue().
llvm-svn: 106279
2010-06-18 14:22:04 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
962d3d700b fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.

llvm-svn: 98712
2010-03-17 05:41:18 +00:00
Chris Lattner
01e70df9b2 finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.

llvm-svn: 98366
2010-03-12 18:55:20 +00:00
Chris Lattner
07e124cec5 make TargetLoweringObjectFile::getExprForDwarfReference
just make unnamed temp symbols instead of having to come
up with its own names.

llvm-svn: 98324
2010-03-12 01:56:43 +00:00
Chris Lattner
5aefaeb42e fix a fixme in TargetLoweringObjectFile::getExprForDwarfReference
where we used ot create an MCSymbol for ".".  Now emit an assembler
temporary label and reference it instead of "." textually.

rdar://7739457

llvm-svn: 98292
2010-03-11 21:55:20 +00:00
Chris Lattner
1ce9dfd498 rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol.  Change it to take an MCStreamer,
which is currently unused.

No functionality change.

llvm-svn: 98278
2010-03-11 19:41:58 +00:00
Chris Lattner
e34dde1e83 move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!

llvm-svn: 98145
2010-03-10 07:20:42 +00:00
Chris Lattner
ed0b8d36e4 set the temporary bit on MCSymbols correctly.
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Bill Wendling
964b01232c Make error statement more personal.
llvm-svn: 96410
2010-02-16 22:47:14 +00:00
Anton Korobeynikov
ef1862e256 Move TLOF implementations to libCodegen to resolve layering violation.
llvm-svn: 96288
2010-02-15 22:37:53 +00:00
Anton Korobeynikov
4d16d87eb1 Add suffix for stubs, so we won't have name clashes with private symbols.
llvm-svn: 96286
2010-02-15 22:36:26 +00:00
Anton Korobeynikov
dccd240998 Preliminary patch to improve dwarf EH generation - Hooks to return Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there
llvm-svn: 96285
2010-02-15 22:35:59 +00:00
Benjamin Kramer
13b3fa1f36 Simplify some uses of str(n)cmp with StringRef.
llvm-svn: 94189
2010-01-22 18:21:23 +00:00
Chris Lattner
15e2a64ec2 stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.

llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Chris Lattner
63ef960b83 make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).

llvm-svn: 93846
2010-01-19 04:15:51 +00:00
Chris Lattner
c42d723862 fix a significant difference between llvm and gcc on ELF systems:
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' 
section.  Fixing this will allow simplifications next up.

llvm-svn: 93844
2010-01-19 03:06:01 +00:00
Chris Lattner
77f12b9ee0 introduce a section kind for common linkage. Use this to slightly
simplify and commonize some of the asmprinter logic for globals.

This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.

llvm-svn: 93843
2010-01-19 02:48:26 +00:00
Chris Lattner
816fcd1287 Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.

llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Chris Lattner
f7c6508544 Get MCSymbol out of the mangling business, and move all the logic
to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.

llvm-svn: 93690
2010-01-17 19:23:46 +00:00
Chris Lattner
51e8abe640 move the mangler into libtarget from vmcore.
llvm-svn: 93664
2010-01-16 21:57:06 +00:00
Chris Lattner
e4a8737985 fix build failure.
llvm-svn: 93628
2010-01-16 03:38:27 +00:00
Chris Lattner
a00f220023 remove a couple of actively incorrect uses of getMangledName.
llvm-svn: 93627
2010-01-16 02:16:09 +00:00
Chris Lattner
4ce6464609 fix ELF section mangling stuff for weak symbols to not use
obsolete Mangler interfaces.

llvm-svn: 93356
2010-01-13 21:29:21 +00:00
Chris Lattner
b255aee77a Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::
SelectSectionForGlobal, unbreaking weak globals with no-name.

llvm-svn: 93336
2010-01-13 19:19:17 +00:00
Chris Lattner
29a0ff2e70 add a fixme, ELF MCSection isn't quite right and weak unnamed globals are broken
on linux (even though they are pointless, they shouldn't ICE).

llvm-svn: 93308
2010-01-13 08:02:14 +00:00
Chris Lattner
f2090cf7fd eliminate some uses of Mangler::makeNameProper.
llvm-svn: 93305
2010-01-13 07:56:59 +00:00
Chris Lattner
3c2fad1fc6 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.

llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Eric Christopher
1d452e5c87 We need to put any kind of data with a relocation into a
not-readonly segment on darwin.

llvm-svn: 92933
2010-01-07 19:44:05 +00:00
Bill Wendling
fcbf6174ab Reverting the EH table patches.
$ svn merge -c -89279 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89279 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/Target/TargetLoweringObjectFile.cpp
$ svn merge -c -89270 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89270 into '.':
G    lib/CodeGen/AsmPrinter/DwarfException.cpp
G    lib/Target/TargetLoweringObjectFile.cpp

llvm-svn: 89379
2009-11-19 19:21:09 +00:00
Bill Wendling
b396532e98 The "ReadOnlyWithRel" enum seems to apply more to what Darwin does with the EH
exception table than DataRel.

llvm-svn: 89279
2009-11-19 00:09:14 +00:00
Bill Wendling
5ab3ea88a2 Attempt #2:
Place the EH table in the __TEXT section on MachO. It saves space.

llvm-svn: 89270
2009-11-18 23:18:46 +00:00
Chris Lattner
8abcfed7c7 add some missing #includes
llvm-svn: 86367
2009-11-07 09:20:54 +00:00
Daniel Dunbar
4daaf9d3f4 Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Bill Wendling
69ad4a0004 --- Reverse-merging r82282 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/CodeGen/AsmPrinter/DwarfException.h

--- Reverse-merging r82274 into '.':
U    lib/Target/TargetLoweringObjectFile.cpp
G    lib/CodeGen/AsmPrinter/DwarfException.cpp

These revisions were breaking everything.

llvm-svn: 82396
2009-09-20 09:13:15 +00:00
Bill Wendling
fe2bcb9889 Still one more thing wrong here...
llvm-svn: 82356
2009-09-20 02:27:06 +00:00
Bill Wendling
d402d7374a Here's fun! It turns out that these filter functions can be internal. If they're
internal, they shouldn't use the indirect pointer stuff. In the case of
throw_rethrow_test, it was marked as 'internal' and calculated its own offset to
its contents.

llvm-svn: 82354
2009-09-20 02:19:49 +00:00
Bill Wendling
5dfef4dce4 Revert r82274. It's causing failures in the CINT2006 benchmarks.
llvm-svn: 82336
2009-09-19 22:02:37 +00:00
Bill Wendling
6ddbe2a6ad It's inefficient to have place the exception tables (which contain the LSDA)
into the __DATA section. At launch time, dyld has to update most of the section
to fix up the type info pointers. It's better to place it into the __TEXT
section and use pc-rel indirect pointer encodings. Similar to the personality
routine.

llvm-svn: 82274
2009-09-18 21:14:36 +00:00
Chris Lattner
be5afd41e3 pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
currently unused.

llvm-svn: 82157
2009-09-17 18:49:52 +00:00
Chris Lattner
7b52d90c9e Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();

llvm-svn: 81991
2009-09-16 01:46:41 +00:00
Anton Korobeynikov
09f22baf8a Provide proper section flags for various BSS flavours
llvm-svn: 81322
2009-09-09 08:48:53 +00:00
Anton Korobeynikov
d9c185f6e9 Whitespace cleanup
llvm-svn: 81321
2009-09-09 08:41:20 +00:00
Daniel Dunbar
e3d14c797d Simplify.
llvm-svn: 80176
2009-08-26 23:12:33 +00:00
Chris Lattner
17c3a9cf99 fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections
llvm-svn: 79346
2009-08-18 16:56:17 +00:00
Anton Korobeynikov
d2d8c91b9f Text sections should have 'exec' flag set. This seems to unbreak libstdc++ on linux.
Patch by Dmitry Gorbachev!

llvm-svn: 79334
2009-08-18 14:06:12 +00:00
Benjamin Kramer
d1c6b5de4e Clear the uniquing table when initializing TLOF to avoid a crash when the TLOF is reinitialized with a different MCContext.
llvm-svn: 79253
2009-08-17 17:05:44 +00:00
Richard Osborne
358842178f Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget.

llvm-svn: 79249
2009-08-17 16:37:11 +00:00
Chris Lattner
07186e7840 the .eh_frame sections we generate need to be writable (which
is why they are datarel).  This should fix PR4724, and is fallout
from r78890.

llvm-svn: 79111
2009-08-15 16:54:02 +00:00