History log of /external/llvm/tools/lto/LTOModule.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
03c209733bd5459d84177e43eb19dabe64be3da7 01-Feb-2013 Chandler Carruth <chandlerc@gmail.com> Fix a copy/paste-o that got missed because 'check' doesn't build lto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
5da3665cc501ed8928e63678254357214ec0b9eb 01-Feb-2013 Chandler Carruth <chandlerc@gmail.com> Give the MCStreamer class hierarchy LLVM RTTI facilities for use with
isa<> and dyn_cast<>. In several places, code is already hacking around
the absence of this, and there seem to be several interfaces that might
be lifted and/or devirtualized using this.

This change was based on a discussion with Jim Grosbach about how best
to handle testing for specific MCStreamer subclasses. He said that this
was the correct end state, and everything else was too hacky so
I decided to just make it so.

No functionality should be changed here, this is just threading the kind
through all the constructors and setting up the classof overloads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
030f63a397edc20f8f661bac62f7b90cb5cf57bc 14-Jan-2013 Eli Bendersky <eliben@google.com> Expose an InitToTextSection through MCStreamer.

The aim of this patch is to fix the following piece of code in the
platform-independent AsmParser:

void AsmParser::CheckForValidSection() {
if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
TokError("expected section directive before assembly directive");
Out.SwitchSection(Ctx.getMachOSection(
"__TEXT", "__text",
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
0, SectionKind::getText()));
}
}

This was added for the "-n" option of llvm-mc.

The proposed fix adds another virtual method to MCStreamer, called
InitToTextSection. Conceptually, it's similar to the existing
InitSections which initializes all common sections and switches to
text. The new method is implemented by each platform streamer in a way
that it sees fit. So AsmParser can now do this:

void AsmParser::CheckForValidSection() {
if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
TokError("expected section directive before assembly directive");
Out.InitToTextSection();
}
}

Which is much more reasonable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
6c1d4972cf1cd6b6072e31c05f97abb1ed7a8497 07-Jan-2013 Eli Bendersky <eliben@google.com> Add the align_to_end option to .bundle_lock in the MC implementation of aligned
bundling. The document describing this feature and the implementation has also
been updated:

https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4766ef41b31e4f97bce1179c3b0398303bf65356 20-Dec-2012 Eli Bendersky <eliben@google.com> Aligned bundling support. Following the discussion here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056754.html

The proposal and implementation are fully documented here:
https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm

Tests will follow shortly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
2c3a4641a7785da78839caf574277df9cd93b52c 16-Dec-2012 Reed Kotler <rkotler@mips.com> This patch is needed to make c++ exceptions work for mips16.

Mips16 is really a processor decoding mode (ala thumb 1) and in the same
program, mips16 and mips32 functions can exist and can call each other.

If a jal type instruction encounters an address with the lower bit set, then
the processor switches to mips16 mode (if it is not already in it). If the
lower bit is not set, then it switches to mips32 mode.

The linker knows which functions are mips16 and which are mips32.
When relocation is performed on code labels, this lower order bit is
set if the code label is a mips16 code label.

In general this works just fine, however when creating exception handling
tables and dwarf, there are cases where you don't want this lower order
bit added in.

This has been traditionally distinguished in gas assembly source by using a
different syntax for the label.

lab1: ; this will cause the lower order bit to be added
lab2=. ; this will not cause the lower order bit to be added

In some cases, it does not matter because in dwarf and debug tables
the difference of two labels is used and in that case the lower order
bits subtract each other out.

To fix this, I have added to mcstreamer the notion of a debuglabel.
The default is for label and debug label to be the same. So calling
EmitLabel and EmitDebugLabel produce the same result.

For various reasons, there is only one set of labels that needs to be
modified for the mips exceptions to work. These are the "$eh_func_beginXXX"
labels.

Mips overrides the debug label suffix from ":" to "=." .

This initial patch fixes exceptions. More changes most likely
will be needed to DwarfCFException to make all of this work
for actual debugging. These changes will be to emit debug labels in some
places where a simple label is emitted now.

Some historical discussion on this from gcc can be found at:
http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
613abf3fa6c69f709fbc122caaa74435222c4bf3 11-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Change some functions to take const pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f010c464a11444733ec67e31aace8bcebeaf2588 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort the #include lines for tools/...

Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
47ed8a161caa898cc00c85c8f8a063a0e18d8915 12-Oct-2012 Bob Wilson <bob.wilson@apple.com> Set default CPU for Darwin targets with LTO. <rdar://problem/12457841>

This is a temporary hack until Bill's project to record command line options
in the LLVM IR is ready. Clang currently sets a default CPU but that isn't
recorded anywhere and it doesn't get used in the final LTO compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
791cfc211a9801002bfda6b3eb4de7e041f04f53 08-Oct-2012 Micah Villmow <villmow@gmail.com> Move TargetData to DataLayout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
59324297650c12a8dccf1a7ad650a9e895fdc17e 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org> Stop casting away const qualifier needlessly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
35907e98626b33f6406dc498201fc59ced282c8a 21-Aug-2012 Chad Rosier <mcrosier@apple.com> Add support for the --param ssp-buffer-size= driver option.
PR9673

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
32811bef956e0fae4329e6515420d85f7e510660 17-Aug-2012 Bill Wendling <isanbard@gmail.com> Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' to
make it more consistent with its intended semantics.

The `linker_private_weak_def_auto' linkage type was meant to automatically hide
globals which never had their addresses taken. It has nothing to do with the
`linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix
among other things.

The intended semantic is more like the `linkonce_odr' linkage type.

Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore
changing the semantics so that it produces the correct output for the linker.

Note: The old linkage name `linker_private_weak_def_auto' will still parse but
is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0.
<rdar://problem/11754934>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
5682527882aa3ddc74d0b283496fedd069a8e55d 09-Aug-2012 Bill Wendling <isanbard@gmail.com> Cache a commonly used reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
eda3fc673450552808edfbf076d6bf26798acc64 07-Aug-2012 Bill Wendling <isanbard@gmail.com> Reduce indentation by early exiting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
9ac0aaa6afe4162b4db32833f9f176ac05ce6f8f 06-Aug-2012 Bill Wendling <isanbard@gmail.com> Add a way to grab the target options from the LTO command line.

When the command line target options were removed from the LLVM libraries, LTO
lost its ability to specify things like `-disable-fp-elim'. Add this back by
adding the command line variables to the `lto' project.
<rdar://problem/12038729>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
df42d41cd64b35e359364ea9804d71f30864d45d 22-Jun-2012 Evan Cheng <evan.cheng@apple.com> Forgot this patch in r159023.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
383fd7afd9cd2431fdb0b32130fc8125903a7fa8 11-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a use after free when the streamer is destroyed. Fixes pr12622.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
90e7d4f6f006672a59ff8e031a190c76f9dab4b3 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Reformatting. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
8ba9405c5ca9d95a61c5d575f16506ddac5d67d3 02-Apr-2012 Bill Wendling <isanbard@gmail.com> Hack the hack. If we have a situation where an ASM object is defined but isn't
reflected in the LLVM IR (as a declare or something), then treat it like a data
object.

N.B. This isn't 100% correct. The ASM parser should supply more information so
that we know what type of object it is, and what attributes it should have.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1fcbca05db736afc3e555aadc14ae3a5bef59198 02-Apr-2012 Bill Wendling <isanbard@gmail.com> It could come about that we parse the inline ASM before we get a potential
definition for it. In that case, we want to wait for the potential definition
before we create a symbol for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ab53bc76fd0f4863c9bdccf666fe8eed3d6bf702 31-Mar-2012 Bill Wendling <isanbard@gmail.com> Cleanup whitespace and trim some of the #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
5ff4bc20a131cdf6fd0706b7abd80e16efc2f0e7 31-Mar-2012 Bill Wendling <isanbard@gmail.com> * Set the scope attributes for the ASM symbol we added to be the value passed
into the function.
* Reorder some header files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
24b878031d4f62baf0e9a0573aeebc9dfd54b546 29-Mar-2012 Bill Wendling <isanbard@gmail.com> Make some headway towards compiling all of LLVM.

Module-level ASM may contain definitions of functions and globals. However, we
were not telling the linker that these globals had definitions. As far as it was
concerned, they were just declarations.

Attempt to resolve this by inserting module-level ASM functions and globals into
the '_symbol' set so that the linker will know that they have values.

This gets us further towards our goal of compiling LLVM, but it still has
problems when linking libLTO.dylib because of the `-dead_strip' flag that's
passed to the linker.

<rdar://problem/11124216>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
9f3b483b814efb536d1ad391e664443333d14179 29-Mar-2012 Bill Wendling <isanbard@gmail.com> Cache the end() iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3bb17380b1c87fa23ef9fe208ce6f56d352df611 29-Mar-2012 Bill Wendling <isanbard@gmail.com> Cleanup some whitespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
61476d6f90b772c0e6c725308199afe10743ce0e 28-Mar-2012 Bill Wendling <isanbard@gmail.com> Inline function into its one caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
62cf01e4c5de703e7712c72d12f577153b373cba 28-Mar-2012 Bill Wendling <isanbard@gmail.com> Reformat the LTOModule code to be more inline with LLVM's coding standards. Add
a bunch of comments for the various functions. No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
18c7f80b3e83ab584bd8572695a3cde8bafd9d3c 05-Feb-2012 Chris Lattner <sabre@nondot.org> reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul. Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
91766fe066efe6e0969ba805a2e3726a70ed34a3 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.

These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ca012b8b2341a987f0022adc42424ac8ed26752a 31-Jan-2012 Chris Lattner <sabre@nondot.org> update this to ConstantDataArray. There are no tests and this isn't using the preferred functionality for ripping apart strings, so I have no way to test this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ebd4c05c3cbd61215366d4d16f1c1a2e57e7156d 27-Jan-2012 Jim Grosbach <grosbach@apple.com> Better diagnostic for malformed .org assembly directive.

Provide source line number information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
99b4237c1647156f0e1d3d7e03efdab23ed79778 07-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Split Finish into Finish and FinishImpl to have a common place to do end of
file error checking. Use that to error on an unfinished cfi_startproc.

The error is not nice, but is already better than a segmentation fault.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
8a8d479214745c82ef00f08d4e4f1c173b5f9ce2 02-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Move global variables in TargetMachine into new TargetOptions class. As an API
change, now you need a TargetOptions object to create a TargetMachine. Clang
patch to follow.

One small functionality change in PTX. PTX had commented out the machine
verifier parts in their copy of printAndVerify. That now calls the version in
LLVMTargetMachine. Users of PTX who need verification disabled should rely on
not passing the command-line flag to enable it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
931d4c204390752b30d4459264f8786de95b36d8 04-Nov-2011 Bill Wendling <isanbard@gmail.com> Reformatting changes to get rid of blank lines, put code on one line, and to
decrease some code indentation. No intended functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
24c5b368417d80baf4d10e691d4ac2d180fe2156 04-Nov-2011 Bill Wendling <isanbard@gmail.com> Move comment to the correct place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
a7280fd61933f1268f69045cfbea46edb739726d 04-Nov-2011 Bill Wendling <isanbard@gmail.com> Make the Mangler an ivar so that it doesn't have to be passed around everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b9bff969e96a24da18d6c5d0d623a7d790d41fa2 04-Nov-2011 Bill Wendling <isanbard@gmail.com> Refactor the MCContext so that it's an ivar instead of a local which is passed
around. This is important for some future work as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0173864d8a87d9243d304fbf91b556e20b5a32fc 01-Nov-2011 Sebastian Pop <spop@codeaurora.org> rename getHostTriple into getDefaultTargetTriple



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
6d483c2b0712d0111b02d23cda7c65c0f43cf1f1 08-Sep-2011 Ivan Krasin <krasin@chromium.org> lto/addAsmGlobalSymbols: fast path when no module level asm is present.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
603e103988d98c0ea5d37e7cceaf5bbffe076f28 08-Sep-2011 Ivan Krasin <krasin@chromium.org> lto/addAsmGlobalSymbols: fail fracefully when the target does not define AsmParser.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
36a16015ac108e2f0dd2d6d96a6d364bc74c50d7 02-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Don't drop alignment info on local common symbols.

- On COFF the .lcomm directive has an alignment argument.
- On ELF we fall back to .local + .comm

Based on a patch by NAKAMURA Takumi.

Fixes PR9337, PR9483 and PR10128.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3e74d6fdd248e20a280f1dff3da9a6c689c2c4c3 24-Aug-2011 Evan Cheng <evan.cheng@apple.com> Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1b84cce77f8bccc905b4800927ce9016f76c1c40 16-Aug-2011 Jim Grosbach <grosbach@apple.com> Remove unused Target argument from AsmParser construction methods.

The argument is unused, and is a layering violation in any case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
94b9550a32d189704a8eae55505edf62662c0534 26-Jul-2011 Evan Cheng <evan.cheng@apple.com> Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
a7cfc08ebe737062917b442830eb5321b0f79e89 23-Jul-2011 Evan Cheng <evan.cheng@apple.com> Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
e78085a3c03de648a481e9751c3094c517bd7123 22-Jul-2011 Evan Cheng <evan.cheng@apple.com> Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
203576aa0cb9d8bf2d2e4d910ebab4b7a63262ae 20-Jul-2011 Evan Cheng <evan.cheng@apple.com> Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.

There is still a bit more refactoring left to do in Targets. But we are now very
close to fixing all the layering issues in MC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
e76a33b9567d78a5744dc52fcec3a6056d6fb576 20-Jul-2011 Evan Cheng <evan.cheng@apple.com> Add MCObjectFileInfo and sink the MCSections initialization code from
TargetLoweringObjectFileImpl down to MCObjectFileInfo.

TargetAsmInfo is done to one last method. It's *almost* gone!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
439661395fd2a2a832dba01c65bc88718528313c 19-Jul-2011 Evan Cheng <evan.cheng@apple.com> Introduce MCCodeGenInfo, which keeps information that can affect codegen
(including compilation, assembly). Move relocation model Reloc::Model from
TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0e6a052331f674dd70e28af41f654a7874405eab 18-Jul-2011 Evan Cheng <evan.cheng@apple.com> Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo down
to MCRegisterInfo. Also initialize the mapping at construction time.

This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step
towards fixing the layering violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1abf2cb59b8d63415780a03329307c0997b2670c 15-Jul-2011 Evan Cheng <evan.cheng@apple.com> Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
672b93a3324cc1da6d374eed4c75c050a9cad7be 14-Jul-2011 Evan Cheng <evan.cheng@apple.com> Unfortunately several files in MC are badly violating layering rule by using
TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are
other cases of violations, but this is probably the worst.

This patch is but one small step towards fixing this. 500 more steps to go. :-(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
bf843e6974007a9a125453a61a2c4a64ee3a6186 12-Jul-2011 Cameron Zwarich <zwarich@apple.com> Fix LTO after the recent MC subtarget refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ffc0e73046f737d75e0a62b3a83ef19bcef111e3 09-Jul-2011 Evan Cheng <evan.cheng@apple.com> Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change
subtarget state (e.g. .code 16) and it must be reflected in other
modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance
must be shared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ebdeeab812beec0385b445f3d4c41a114e0d972f 08-Jul-2011 Evan Cheng <evan.cheng@apple.com> Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
to generate asm matcher subtarget feature queries. e.g.
"ModeThumb,FeatureThumb2" is translated to
"(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
276365dd4bc0c2160f91fd8062ae1fc90c86c324 30-Jun-2011 Evan Cheng <evan.cheng@apple.com> Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.

The fix is to just have the clients explictly pass the CPU name!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ab8be96fd30ca9396e6b84fdddf1ac6208984cad 29-Jun-2011 Evan Cheng <evan.cheng@apple.com> Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
bd35f27ce9ecf7a6e6e1028dfc8652023cab265b 28-Jun-2011 Chad Rosier <mcrosier@apple.com> Reinstate r133516 "Remove some unnecessary uses of c_str()." A trailing null
character in std::string was causing failures for a few ObjC and Obj-C++ tests
when -flto was enabled. Revision 133999 resolved this issue. Thanks Jay!
rdar://9685235
PR10210


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4f91054fe4a593f23b46abe359d2df9aebc50f10 28-Jun-2011 Jay Foad <jay.foad@gmail.com> PR10210: New method ConstantArray::getAsCString(). Use it in LTO to
avoid getting embedded trailing null bytes in std::strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
26f448079f2dc070da637e346a0635ad3127df7d 28-Jun-2011 Chad Rosier <mcrosier@apple.com> Revert r133516 "Remove some unnecessary uses of c_str()."
This was causing compile-time failures for some of the Objc and Obj-C++
benchmarks. The specific errors were of the form: "ld: duplicate symbol …"
rdar://9660124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
06155e88d09c273edf509f511f717c38a7e2d263 21-Jun-2011 Jay Foad <jay.foad@gmail.com> Remove some unnecessary uses of c_str().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2be 01-May-2011 Rafael Espindola <rafael.espindola@gmail.com> Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
e8cfbd843d737e1f95c3032c7670c2be3838a6f6 22-Apr-2011 Rafael Espindola <rafael.espindola@gmail.com> Remove unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
333ed454d0c20d0f4999f7c9a404688b254a0cb0 21-Apr-2011 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f19d7a7af3f10b6d43f9e8b0271f0f836a33d52c 18-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Use lazy parsing in LTO. Unfortunately this is only a 3% time saving for
'ar'. Have to figure out how to make libLTO even lazier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
9a4584b54b1c2f212e77fe9cd3ebd3f05bac3118 18-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Simplify the computation of undefined symbols. Instead of walking
functions and initializers, just report the declarations present in
the module.

The motivation is to open the way for using the lazy module parsing,
which should speed up clients that just want a symbol list (nm, ar).

This is slightly less precise, but since both -strip-dead-prototypes
and -globaldce are part of the standard pipeline, this shouldn't
change the result for clang/dragonegg produced binaries.

Any decl in an IL file was also put there because a FE expected it
to be necessary, so this should not be a problem for "-O0 -emit-llvm".

As a sanity check, I have bootstrapped clang on linux and built
firefox on both linux and darwin. A clang bootstrap on darwin
with LTO fails with or without this patch because, ironically,
the linker doesn't like the combination of dead_strip and LTO
when building libLTO.so :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0e8d588948cc4483f3f19e388d18e8a07c7574df 18-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> tools/lto/LTOModule.cpp: Eliminate an unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
9916d2ac3941513e301e39dee76a981c7caab694 17-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Use RequiresNullTerminator to create buffers without a null terminator
instead of copying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f21b1058a194f411000bdd8000a8b675a7874056 17-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Add support in the LTO library for loading an object from the middle
of an file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
38c4e535493363b96eac47af9e7c056530137bea 02-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Add a special streamer to libLTO that just records symbols definitions and
uses.

The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
cd6c93ec48937ab4f76dfd3bf5dc7e68ed781508 20-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix some memory leaks and avoid looking in the hash tables twice.
libxul links in 7m0.403s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ef1860a117b4a35918eb9793a7b94715e12a3a42 11-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Remove std::string version of getNameWithPrefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b4cc031a3e1306fea74c9211d50c5cde6d9a8cd5 08-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4cb310b67d95756c62ab3d7c76d0a75c4fb3403f 01-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Don't tell the linker about available_externally definitions. If we do, it will
complain about duplicated definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3ff9563c3e391954b2e224afcf8b2b0fcc3888aa 16-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
89b9372605db2ce3b0085c84089e389f7bc1fbdd 10-Dec-2010 Rafael Espindola <rafael.espindola@gmail.com> Fixed version of 121434 with no new memory leaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f7fd4aa2610f46467369de07f3ec669561d79be0 10-Dec-2010 Rafael Espindola <rafael.espindola@gmail.com> Revert my previous patch to make the valgrind bots happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1c952b9cc98e84b28f68f0f6cf11197263f89863 10-Dec-2010 Rafael Espindola <rafael.espindola@gmail.com> Initial support for the cfi directives. This is just enough to get

f:
.cfi_startproc
nop
.cfi_endproc

assembled (on ELF).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f2f516fc2680168caac9981a4dd17cc37c639c71 09-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> More code not compiled by CMake. :(.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3cc52ea33c0b96d1682f14fc45c45b57df0f39b6 29-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> I swear I did a make clean and make before committing all this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
02003caf2291ebb2d634e1938553e58e5dd0dce8 20-Oct-2010 Rafael Espindola <rafael.espindola@gmail.com> Record sysbols created by aliases. Fixes PR8414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
34711747a1d2c8713e69333bacef1c880810e371 06-Oct-2010 Bill Wendling <isanbard@gmail.com> Provide a fast "get me the target triple from the module" API. This can
drastically reduce the linking time during LTO.

Patch by Shantonu Sen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
7afea0cfc4abebaf4cadcc37acd30fb251a5faf3 27-Sep-2010 Bill Wendling <isanbard@gmail.com> Add a new scope type "LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN" for the
"linker_private_weak_auto_def" linkage type for LTO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
563ef5ec911d219b54fdb508518abd02a8dd3cfd 27-Sep-2010 Bill Wendling <isanbard@gmail.com> The "linker_private_weak*" linkages should set the LTO_SYMBOL_DEFINITION_WEAK
during LTO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f4452c37d03ab6cdcd2b23cb15b921c0bba591a7 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> lto: Fix an inverted conditional which prevented the addition of symbols scraped
from inline assembly, except in cases where they had already been seen (in which
case they would get added twice).
- I can't see how this ever worked...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
8d0843dcffad90ba200663c5b3aca3ce1e362e96 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> lto: Fix gratuitous memory leaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
e41d90094c9dbbabd6031957689f67ea504ed616 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> lto: Reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b06913dd183fe4d294b88a166d4180d3de660135 11-Aug-2010 Daniel Dunbar <daniel@zuster.org> LTOModule.cpp: Fix numerous style issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
cbb170d057aa6692b19f577b1e09a6c1c7a26969 09-Aug-2010 Rafael Espindola <rafael.espindola@gmail.com> Make it possible to set the target triple and expose that with an option in the
gold plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
81043ee5dc4cca470db8d45e080ba0a38efbffc2 11-May-2010 Bill Wendling <isanbard@gmail.com> The getDefaultSubtargetFeatures method of SubtargetFeature did actually return a
string of features for that target. However LTO was using that string to pass
into the "create target machine" stuff. That stuff needed the feature string to
be in a particular form. In particular, it needed the CPU specified first and
then the attributes. If there isn't a CPU specified, it required it to be blank
-- e.g., ",+altivec". Yuck.

Modify the getDefaultSubtargetFeatures method to be a non-static member
function. For all attributes for a specific subtarget, it will add them in like
normal. It will also take a CPU string so that it can satisfy this horrible
syntax.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4c842dda3939c6b9f83ba7e8e19e43445cd9a832 06-Apr-2010 Chris Lattner <sabre@nondot.org> stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b87c305fa77650ee581d4a8c65a0757f88002441 12-Mar-2010 Chris Lattner <sabre@nondot.org> give Mangler access to TargetData.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
5ef31a039dbb9c36cfd78442b3554d1b6974ec4c 12-Mar-2010 Chris Lattner <sabre@nondot.org> make the mangler take an MCContext instead of an MAI.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f0356fe140af1a30587b9a86bcfb1b2c51b8ce20 27-Jan-2010 Jeffrey Yasskin <jyasskin@google.com> Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods. The bindings to
other languages still use the ModuleProvider concept. It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
c0dba723d119adc8c7b49c6d0e97d10eac4428fc 17-Jan-2010 Chris Lattner <sabre@nondot.org> now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in. Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
45111d160cf0910030eeb6a949c69273502e5ad5 16-Jan-2010 Chris Lattner <sabre@nondot.org> move the mangler into libtarget from vmcore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
7c3418ba580ca096963b36ba30c3a1deebb6ca80 16-Jan-2010 Chris Lattner <sabre@nondot.org> remove calls to dead methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
469340493c48eb22b630bbd311db867c9d7953d6 16-Jan-2010 Chris Lattner <sabre@nondot.org> switch liblto to use the new getNameWithPrefix() method instead of getMangledName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
e823db8bae7fe42cd4f1fa861bec8c36a636702b 18-Nov-2009 Viktor Kutuzov <vkutuzov@accesssoftek.com> Added getDefaultSubtargetFeatures method to SubtargetFeatures class which returns a correct feature string for given triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4136e7b90ea5ce8b4d708cdd54d0b052d520a96e 23-Sep-2009 Gabor Greif <ggreif@gmail.com> pretty mechanical changes to match coding guidelines (blessed by sabre on IRC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
af76e592c7f9deff0e55c13dbb4a34f07f1c7f64 22-Aug-2009 Chris Lattner <sabre@nondot.org> Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4b3d57228cae1cba0897b80a73fddd4b8a61894a 04-Aug-2009 Daniel Dunbar <daniel@zuster.org> No really, it's unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4bd03abe593222b26e84066223feb321bf738625 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Remove now unused arguments from TargetRegistry::lookupTarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3c2d4bf97fa96fe171883cd80e4ea93fc43563e6 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Pass target triple string in to TargetMachine constructor.

This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
db1e9981b829ba57651dd8e13c0a960fde773209 28-Jul-2009 Nick Lewycky <nicholas@mxc.ca> Remove memory corruption bug. string.c_str() was returning a temporary that was
dead before we used it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
d42b58b61cd773e9f798d02c42652488d67d38df 27-Jul-2009 Nick Lewycky <nicholas@mxc.ca> Fix libLTO:
* Call InitializeAllTargets on every path where we might query the
TargetRegistry. This fixes PR4604.
* flush the formatted_raw_ostream& or else not all of the assembly will make
it to the .s file. (It doesn't do this in its destructor?!)
* Due to a reversed conditional, libLTO was reporting many symbols as both
defined and undefined, including two definitions of the same symbol name
in its symbol list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
460f656475738d1a95a6be95346908ce1597df25 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove Value::getName{Start,End}, the last of the old Name APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
a5881e3060aee9f82aef3747a97650e5eafe893a 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
target triple, with a few additional flags.

- Remove getClosestStaticTargetForModule, the moral equivalent is now:
lookupTarget(Mod->getTargetTriple, true, false, ...);

- This no longer does the fuzzy matching with target data (based on endianness
and pointer width) that getClosestStaticTargetForModule was doing, but this
was deemed unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
6316fbcb04af00fe76b6526fab09f51484014b3e 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.

- NIFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ac95cc79ac0b899d566cc29c0f646f39c2fa35c0 16-Jul-2009 Dan Gohman <gohman@apple.com> Convert more tools code from cerr and cout to errs() and outs().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ff9834ab9daeee25dbb67ae5e2341930cde46c86 16-Jul-2009 Daniel Dunbar <daniel@zuster.org> Kill off last uses of TargetMachineRegistry class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
51b198af83cb0080c2709b04c129a3d774c07765 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> Reapply TargetRegistry refactoring commits.

--- Reverse-merging r75799 into '.':
U test/Analysis/PointerTracking
U include/llvm/Target/TargetMachineRegistry.h
U include/llvm/Target/TargetMachine.h
U include/llvm/Target/TargetRegistry.h
U include/llvm/Target/TargetSelect.h
U tools/lto/LTOCodeGenerator.cpp
U tools/lto/LTOModule.cpp
U tools/llc/llc.cpp
U lib/Target/PowerPC/PPCTargetMachine.h
U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U lib/Target/PowerPC/PPCTargetMachine.cpp
U lib/Target/PowerPC/PPC.h
U lib/Target/ARM/ARMTargetMachine.cpp
U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U lib/Target/ARM/ARMTargetMachine.h
U lib/Target/ARM/ARM.h
U lib/Target/XCore/XCoreTargetMachine.cpp
U lib/Target/XCore/XCoreTargetMachine.h
U lib/Target/PIC16/PIC16TargetMachine.cpp
U lib/Target/PIC16/PIC16TargetMachine.h
U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U lib/Target/Alpha/AlphaTargetMachine.cpp
U lib/Target/Alpha/AlphaTargetMachine.h
U lib/Target/X86/X86TargetMachine.h
U lib/Target/X86/X86.h
U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U lib/Target/X86/X86TargetMachine.cpp
U lib/Target/MSP430/MSP430TargetMachine.cpp
U lib/Target/MSP430/MSP430TargetMachine.h
U lib/Target/CppBackend/CPPTargetMachine.h
U lib/Target/CppBackend/CPPBackend.cpp
U lib/Target/CBackend/CTargetMachine.h
U lib/Target/CBackend/CBackend.cpp
U lib/Target/TargetMachine.cpp
U lib/Target/IA64/IA64TargetMachine.cpp
U lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U lib/Target/IA64/IA64TargetMachine.h
U lib/Target/IA64/IA64.h
U lib/Target/MSIL/MSILWriter.cpp
U lib/Target/CellSPU/SPUTargetMachine.h
U lib/Target/CellSPU/SPU.h
U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U lib/Target/CellSPU/SPUTargetMachine.cpp
U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U lib/Target/Mips/MipsTargetMachine.cpp
U lib/Target/Mips/MipsTargetMachine.h
U lib/Target/Mips/Mips.h
U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U lib/Target/Sparc/SparcTargetMachine.cpp
U lib/Target/Sparc/SparcTargetMachine.h
U lib/ExecutionEngine/JIT/TargetSelect.cpp
U lib/Support/TargetRegistry.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
2286f8dc4cec0625f7d7a14e2570926cf8599646 15-Jul-2009 Stuart Hastings <stuart@apple.com> Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
dec9803b69ad6dcae9f6f1902e461214a26bd7e7 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> Switch some obvious clients to using the new TargetRegistry.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b8158acc23f5f0bf235fb1c6a8182a38ec9b00b2 14-Jul-2009 Chris Lattner <sabre@nondot.org> Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
would remove $stub but keep the L prefix on a name when emitting the
indirect symbol. This is easy to fix by keeping the name of the stub
and the name of the symbol in a StringMap instead of just keeping a
StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function. The current
logic to print out the personality function from the DWARF information
is a bit of a cesspool right now that duplicates a bunch of other
logic in the asm printer. The short version of it is that it depends
on emitting both the L and _ prefix for symbols (at least on darwin)
and until I can untangle it, it is best to switch the mangler back to
emitting both prefixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1f316e321a8f2fa0e193c5444584a67a8aabe9a8 14-Jul-2009 Daniel Dunbar <daniel@zuster.org> Revert r7561{9,8,7,6}, which depend on r75610.

--- Reverse-merging r75619 into '.':
U lib/Target/DarwinTargetAsmInfo.cpp
U lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Reverse-merging r75618 into '.':
U lib/CodeGen/ELFWriter.cpp
U lib/CodeGen/MachOCodeEmitter.cpp
U lib/CodeGen/MachOWriter.cpp
--- Reverse-merging r75617 into '.':
U lib/Target/CBackend/CBackend.cpp
--- Reverse-merging r75616 into '.':
U tools/bugpoint/Miscompilation.cpp
U tools/lto/LTOCodeGenerator.cpp
U tools/lto/LTOModule.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b5851462d08bc4d5c3f8348faac9fd2f6387d078 14-Jul-2009 Chris Lattner <sabre@nondot.org> rename getValueName -> getMangledName


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
1ca29d318a6632c115b9f62c791077b575494e42 13-Jul-2009 Owen Anderson <resistor@mac.com> As Chris pointed out, this doesn't actually need an LLVMContext to operate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0a5372ed3e8cda10d724feda3c1a1c998db05ca0 13-Jul-2009 Owen Anderson <resistor@mac.com> Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
485ded0db71b2abe51da919bd58501cee345c443 09-Jul-2009 Nick Lewycky <nicholas@mxc.ca> Don't create undefined symbols for aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
0e7a54672cf346ee7c4aae10822c74f7c74f3fed 02-Jul-2009 Owen Anderson <resistor@mac.com> Maintain the old LTO API, by using the global context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4434ed44c45c87a72b7a0bf2f91211f895022b91 02-Jul-2009 Owen Anderson <resistor@mac.com> Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
31895e73591d3c9ceae731a1274c8f56194b9616 01-Jul-2009 Owen Anderson <resistor@mac.com> Hold the LLVMContext by reference rather than by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
8b477ed579794ba6d76915d56b3f448a7dd20120 01-Jul-2009 Owen Anderson <resistor@mac.com> Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4bdf73025a56bd2affad27f6eae93c7f8d2a06d4 02-Jun-2009 Nick Kledzik <kledzik@apple.com> update comments about .objc_ symbols being generated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
3eb445feb22647e867a339f4c59b0a716b03a21a 01-Jun-2009 Nick Kledzik <kledzik@apple.com> <rdar://problem/6927148> libLTO needs to handle i386 magic objc class symbols
Parse __OBJC data structures and synthesize magic .objc_ symbols.
Also, alter mangler so that objc method names are readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
7431af050f287011fd52e64034ede6dd98193feb 24-Apr-2009 Rafael Espindola <rafael.espindola@gmail.com> Add LTO_SYMBOL_DEFINITION_WEAKUNDEF, use that on the gold plugin.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
b454eabe7ff0824356ccdb75459a0312f43254c1 06-Feb-2009 Nick Lewycky <nicholas@mxc.ca> Correct strange whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
4fd40e884c76ffbf1157ab4ca48a099c55eebb4f 29-Nov-2008 Nick Lewycky <nicholas@mxc.ca> Add protected visibility to libLTO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
db6535dd2008897f6446dcfa1ae754d1a6eb0270 19-Jul-2008 Nick Kledzik <kledzik@apple.com> tentative definitions are default visibility

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
413907000e6949849e4b9c2fabda7105f8bedabd 16-Jul-2008 Devang Patel <dpatel@apple.com> Name string length is end position marker - begin position marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
c2aec57c63a8551cef27025dc7f0d2d9e56db013 16-Jul-2008 Devang Patel <dpatel@apple.com> Do not forget global definitions from inline asm code block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
f0d286b77fe40017192b527e5cc5d87974093d54 15-Jul-2008 Devang Patel <dpatel@apple.com> LinkOnce definitions have default scope, like weak definitions. Otherwise, the linker may not be able to match LinkOnce definition from one module with an exteranl reference from other module.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp
ebd69421a2acf0c64f368de87d0795451060ed34 30-Jun-2008 Devang Patel <dpatel@apple.com> Rename new lto2 tool as lto.
lto2->lto


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/tools/lto/LTOModule.cpp