1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

4659 Commits

Author SHA1 Message Date
Rafael Espindola
d89ca7eab7 Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that
before this patch forgetting to set F_Binary would corrupt a file on windows.
Forgetting to set F_Text produces one that cannot be read in notepad, which
is a better failure mode :-)

llvm-svn: 202052
2014-02-24 18:20:12 +00:00
Rafael Espindola
c3ff946af1 Don't make F_None the default.
This will make it easier to switch the default to being binary files.

llvm-svn: 202042
2014-02-24 15:07:20 +00:00
NAKAMURA Takumi
ac921a3563 Simplify linking to system libraries
The LLVMSupport library implementation consolidates all dependencies on
system libraries.  Move the logic gathering system libraries out of
'cmake/modules/LLVM-Config.cmake' and into 'lib/Support/CMakeLists.txt'.
Use the target_link_libraries() command there to tell CMake about the
link dependencies of the LLVMSupport implementation.  CMake will
automatically propagate this to all targets that link LLVMSupport
directly or indirectly.

We still need to build knowledge of system library dependencies into
'llvm-config'.  Store the list of libraries needed in a property on
LLVMSupport and teach 'tools/llvm-config/CMakeLists.txt' to retrieve it
from there.

Drop all calls to 'link_system_libs' and 'get_system_libs' from our
CMake code.  Replace their implementations with a warning that explains
the calls are no longer necessary.  Also drop from 'LLVMConfig.cmake'
the HAVE_* and related variables that were published there only to allow
'get_system_libs' to run outside our build process.

Contributed by Brad King.

llvm-svn: 201969
2014-02-23 06:27:04 +00:00
Quentin Colombet
fc711dd23c [CodeGenPrepare] Move CodeGenPrepare into lib/CodeGen.
CodeGenPrepare uses extensively TargetLowering which is part of libLLVMCodeGen.
This is a layer violation which would introduce eventually a dependence on
CodeGen in ScalarOpts.

Move CodeGenPrepare into libLLVMCodeGen to avoid that.

Follow-up of <rdar://problem/15519855>

llvm-svn: 201912
2014-02-22 00:07:45 +00:00
Rui Ueyama
f084913654 llvm-objdump/COFF: LoadConfiguration does not exist in object file.
llvm-svn: 201883
2014-02-21 20:27:15 +00:00
Rafael Espindola
43f88a22f0 Add a SymbolicFile interface between Binary and ObjectFile.
This interface allows IRObjectFile to be implemented without having dummy
methods for all section and segment related methods.

Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is
still not plugged in since it requires some refactoring to make a Module hold
a DataLayout.

llvm-svn: 201881
2014-02-21 20:10:59 +00:00
NAKAMURA Takumi
761b86605f [CMake] llvm-c/lto.h should be installed if libLTO.a is built.
llvm-svn: 201859
2014-02-21 14:57:09 +00:00
NAKAMURA Takumi
b6856625df [CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static.
llvm-svn: 201856
2014-02-21 14:17:43 +00:00
Rafael Espindola
8b43142712 Make DisableIntegratedAS a TargetOption.
This replaces the old NoIntegratedAssembler with at TargetOption. This is
more flexible and will be used to forward clang's -no-integrated-as option.

llvm-svn: 201836
2014-02-21 03:13:54 +00:00
Rafael Espindola
f60d18d597 One last pass of DataLayout variable renaming.
llvm-svn: 201834
2014-02-21 02:01:42 +00:00
Eli Bendersky
4d0070d02a Set the SuppressWarnings option on tool level and propagate to the library.
The SuppressWarnings flag, unfortunately, isn't very useful for custom tools
that want to use the LLVM module linker. So I'm changing it to a parameter of
the Linker, and the flag itself moves to the llvm-link tool.

For the time being as SuppressWarnings is pretty much the only "option" it
seems reasonable to propagate it to Linker objects. If we end up with more
options in the future, some sort of "struct collecting options" may be a
better idea.

llvm-svn: 201819
2014-02-20 22:19:24 +00:00
Rui Ueyama
c9f1e84a78 llvm-objdump/COFF: Print SEH table addresses.
SEH table addresses are VA in COFF file. In this patch we convert VA to RVA
before printing it, because dumpbin prints them as RVAs.

llvm-svn: 201760
2014-02-20 06:51:07 +00:00
Tobias Grosser
ccc79e1f2b Fix typo
Found by: Duncan P. N. Exon Smith <dexonsmith@apple.com>

llvm-svn: 201726
2014-02-19 22:16:49 +00:00
Eli Bendersky
76b2f4f843 Refactor TargetOptions initialization into a single place.
The same code (~20 lines) for initializing a TargetOptions object from CodeGen
cmdline flags is duplicated 4 times in 4 different tools. This patch moves it
into a utility function.

Since the CodeGen/CommandFlags.h file defines cl::opt flags in a header, it's
a bit of a touchy situation because we should only link them into tools. So this
patch puts the init function in the header.

llvm-svn: 201699
2014-02-19 17:09:35 +00:00
Rui Ueyama
e6bd7df6c8 llvm-objdump/COFF: Print load configuration table.
Load Configuration Table may contain a pointer to SEH table. This patch is to
print the offset to the table. Printing SEH table contents is a TODO.

The layout of Layout Configuration Table is described in Microsoft PE/COFF
Object File Format Spec, but the table's offset/size descriptions seems to be
totally wrong, at least in revision 8.3 of the spec. I believe the table in
this patch is the correct one.

llvm-svn: 201638
2014-02-19 03:53:11 +00:00
Justin Bogner
008ac0494e llvm-cov: Support gcov's extermely lenient treatment of -o
In gcov, the -o flag can accept either a directory or a file name.
When given a directory, the gcda and gcno files are expected to be in
that directory. When given a file, the gcda and gcno files are
expected to be named based on the stem of that file. Non-existent
paths are treated as files.

This implements compatible behaviour.

llvm-svn: 201555
2014-02-18 09:19:48 +00:00
Duncan P. N. Exon Smith
73eacbb02b PGO: llvm-profdata: tool for merging profiles
Introducing llvm-profdata, a tool for merging profile data generated by
PGO instrumentation in clang.

- The name indicates a file extension of <name>.profdata.  Eventually
  profile data output by clang should be changed to that extension.

- llvm-profdata merges two profiles.  However, the name is more general,
  since it will likely pick up more tasks (such as summarizing a single
  profile).

- llvm-profdata parses the current text-based format, but will be
  updated once we settle on a binary format.

<rdar://problem/15949645>

llvm-svn: 201535
2014-02-17 23:22:49 +00:00
Hans Wennborg
7061403ad5 MSBuild integration: get the LibraryPath right (PR18707)
It was pointing to lib\clang\3.4, but now we're on 3.5.
Make CMake insert the right version automatically.

llvm-svn: 201363
2014-02-13 22:01:35 +00:00
Hans Wennborg
081111b3a1 VS Integration: install toolsets for x64 too (PR18738)
This does exactly the same thing as for Win32, except it passes -m64 to
the compiler and the files go in a different directory.

Differential Revision: http://llvm-reviews.chandlerc.com/D2749

llvm-svn: 201269
2014-02-12 23:26:29 +00:00
Eli Bendersky
cfbe523e4a Move more self-contained functionality away from tools/opt/opt.cpp
BreakpointPrinter moves to its own module.

llvm-svn: 201242
2014-02-12 16:48:02 +00:00
Sylvestre Ledru
ef254433f4 Improve the declaration when LDPO_PIE is not available.
Thanks to İsmail Dönmez for the better declaration.

llvm-svn: 201163
2014-02-11 17:30:18 +00:00
Sylvestre Ledru
862cdddf18 If LDPO_PIE is not defined (before binutils 2.23 version),
use the hardcoded declaration 3
See r201110 for the initial change

llvm-svn: 201161
2014-02-11 17:11:32 +00:00
Eli Bendersky
52c6045b5f Move the *PassPrinter into their own module.
These are self-contained in functionality so it makes sense to separate them,
as opt.cpp has grown quite big already.

Following Eric's suggestions, if this code is ever deemed useful outside of
tools/opt, it will make sense to move it to one of the LLVM libraries like IR.

llvm-svn: 201116
2014-02-10 23:34:23 +00:00
Manman Ren
5a1cf3b255 LTO API: add lto_module_create_from_memory_with_path.
This function adds an extra path argument to lto_module_create_from_memory.
The path argument will be passed to makeBuffer to make sure the MemoryBuffer
has a name and the created module has a module identifier.

This is mainly for emitting warning messages from the linker. When we emit
warning message on a module, we can use the module identifier.

rdar://15985737

llvm-svn: 201114
2014-02-10 23:26:14 +00:00
Rafael Espindola
b1c77f900f Fix an old FIXME. LDPO_PIE is available since 2.23, realeased 2012-10-22.
llvm-svn: 201110
2014-02-10 20:38:38 +00:00
Rafael Espindola
4abddc0b33 Change the begin and end methods in ObjectFile to match the style guide.
llvm-svn: 201108
2014-02-10 20:24:04 +00:00
Saleem Abdulrasool
e05d1e5d25 tools: cast the right operand
Properly apply the fix intended by SVN r201032.

llvm-svn: 201036
2014-02-09 03:13:07 +00:00
Saleem Abdulrasool
8b7368c793 tools: explicitly cast to avoid a warning
llvm-svn: 201032
2014-02-09 01:12:21 +00:00
Saleem Abdulrasool
cf3459a929 tools: handle out-of-line personality 0 decoding
In some cases it is possible to have a personality 0 unwinding opcodes in the
extab (such as when .handlerdata is used in the assembly).  Simply decode the 3
opcodes for that case.

llvm-svn: 201030
2014-02-08 23:17:08 +00:00
Chandler Carruth
039285cbbf [PM] Add a new "lazy" call graph analysis pass for the new pass manager.
The primary motivation for this pass is to separate the call graph
analysis used by the new pass manager's CGSCC pass management from the
existing call graph analysis pass. That analysis pass is (somewhat
unfortunately) over-constrained by the existing CallGraphSCCPassManager
requirements. Those requirements make it *really* hard to cleanly layer
the needed functionality for the new pass manager on top of the existing
analysis.

However, there are also a bunch of things that the pass manager would
specifically benefit from doing differently from the existing call graph
analysis, and this new implementation tries to address several of them:

- Be lazy about scanning function definitions. The existing pass eagerly
  scans the entire module to build the initial graph. This new pass is
  significantly more lazy, and I plan to push this even further to
  maximize locality during CGSCC walks.
- Don't use a single synthetic node to partition functions with an
  indirect call from functions whose address is taken. This node creates
  a huge choke-point which would preclude good parallelization across
  the fanout of the SCC graph when we got to the point of looking at
  such changes to LLVM.
- Use a memory dense and lightweight representation of the call graph
  rather than value handles and tracking call instructions. This will
  require explicit update calls instead of some updates working
  transparently, but should end up being significantly more efficient.
  The explicit update calls ended up being needed in many cases for the
  existing call graph so we don't really lose anything.
- Doesn't explicitly model SCCs and thus doesn't provide an "identity"
  for an SCC which is stable across updates. This is essential for the
  new pass manager to work correctly.
- Only form the graph necessary for traversing all of the functions in
  an SCC friendly order. This is a much simpler graph structure and
  should be more memory dense. It does limit the ways in which it is
  appropriate to use this analysis. I wish I had a better name than
  "call graph". I've commented extensively this aspect.

This is still very much a WIP, in fact it is really just the initial
bits. But it is about the fourth version of the initial bits that I've
implemented with each of the others running into really frustrating
problms. This looks like it will actually work and I'd like to split the
actual complexity across commits for the sake of my reviewers. =] The
rest of the implementation along with lots of wiring will follow
somewhat more rapidly now that there is a good path forward.

Naturally, this doesn't impact any of the existing optimizer. This code
is specific to the new pass manager.

A bunch of thanks are deserved for the various folks that have helped
with the design of this, especially Nick Lewycky who actually sat with
me to go through the fundamentals of the final version here.

llvm-svn: 200903
2014-02-06 04:37:03 +00:00
Chandler Carruth
21b641366c [PM] Back out one hunk of the patch in r200901 that was *supposed* to go
in my next patch. Sorry for the breakage.

llvm-svn: 200902
2014-02-06 04:32:33 +00:00
Chandler Carruth
2250f08288 [PM] Wire up the analysis managers in the opt driver. This isn't really
necessary until we add analyses to the driver, but I have such an
analysis ready and wanted to split this out. This is actually exercised
by the existing tests of the new pass manager as the analysis managers
are cross-checked and validated by the function and module managers.

llvm-svn: 200901
2014-02-06 04:25:13 +00:00
Rafael Espindola
98165a6a91 Remove support for not using .loc directives.
Clang itself was not using this. The only way to access it was via llc.

llvm-svn: 200862
2014-02-05 18:00:21 +00:00
Rafael Espindola
e3a1818871 Use the information provided by getFlags to unify some code in llvm-nm.
It is not clear how much we should try to expose in getFlags. For example,
should there be a SF_Object and a SF_Text?

But for information that is already being exposed, we may as well use it in
llvm-nm.

llvm-svn: 200820
2014-02-05 05:19:19 +00:00
Rafael Espindola
e2cb6619df Small fix for llvm-nm handling of weak symbols on ELF (print 'v').
llvm-svn: 200808
2014-02-04 23:53:15 +00:00
Duncan P. N. Exon Smith
7024ad6965 cleanup: scc_iterator consumers should use isAtEnd
No functional change.  Updated loops from:

    for (I = scc_begin(), E = scc_end(); I != E; ++I)

to:

    for (I = scc_begin(); !I.isAtEnd(); ++I)

for teh win.

llvm-svn: 200789
2014-02-04 19:19:07 +00:00
Justin Bogner
8f223c891e llvm-cov: Implement the preserve-paths flag
Until now, when a path in a gcno file included a directory, we would
emit our .gcov file in that directory, whereas gcov always emits the
file in the current directory. In doing so, this implements gcov's
strange name-mangling -p flag, which is needed to avoid clobbering
files when two with the same name exist in different directories.

The path mangling is a bit ugly and only handles unix-like paths, but
it's simple, and it doesn't make any guesses as to how it should
behave outside of what gcov documents. If we decide this should be
cross platform later, we can consider the compatibility implications
then.

llvm-svn: 200754
2014-02-04 10:45:02 +00:00
Justin Bogner
65de807c11 llvm-cov: Implement the object-directory flag
llvm-svn: 200741
2014-02-04 06:41:43 +00:00
Justin Bogner
f5d6ae5d00 llvm-cov: Ignore missing .gcda files
When gcov is run without gcda data, it acts as if the counts are all
zero and labels the file as - to indicate that there was no data. We
should do the same.

llvm-svn: 200740
2014-02-04 06:41:39 +00:00
Rafael Espindola
7dbbf2fea3 Move error handling down to getSymbolNMTypeChar.
llvm-svn: 200727
2014-02-04 00:21:18 +00:00
Rafael Espindola
4007ec608c Simplify getSymbolFlags.
None of the object formats require extra parsing to compute these flags,
so the method cannot fail.

llvm-svn: 200574
2014-01-31 20:57:12 +00:00
NAKAMURA Takumi
3bf2c4f08d Revert r200560, "LTO itself hasn't depended on MCDisassembler any more."
Oh sorry, I missed LTO.exports, ... I checked just only *.cpp(s).

llvm-svn: 200562
2014-01-31 17:57:50 +00:00
NAKAMURA Takumi
6090ccb8f2 LTO itself hasn't depended on MCDisassembler any more.
llvm-svn: 200560
2014-01-31 17:40:11 +00:00
NAKAMURA Takumi
084aff62e6 llvm/tools: Prune redundant target_link_libraries.
llvm-svn: 200559
2014-01-31 17:40:06 +00:00
Rafael Espindola
9d632a659f This file already has a "using namespace object;", use it.
llvm-svn: 200493
2014-01-30 21:51:42 +00:00
Rafael Espindola
fae4ff3453 Only ELF has a dynamic symbol table. Remove it from ObjectFile.
COFF has only one symbol table.
MachO has a LC_DYSYMTAB, but that is not a symbol table, just extra info about
the one symbol table (LC_SYMTAB).
IR (coming soon) also has only one table.

llvm-svn: 200488
2014-01-30 20:45:33 +00:00
Rafael Espindola
1650ee4487 Use early returns and factor the object::Binary creation.
llvm-svn: 200484
2014-01-30 19:24:00 +00:00
Saleem Abdulrasool
bb3d3fdcb2 tools: fix Twine abuse
utohexstr provides a temporary string, making it unsafe to use with the Twine
interface which will not copy the string.  Switch to using std::string.

llvm-svn: 200457
2014-01-30 06:19:27 +00:00
Saleem Abdulrasool
8c7875baee tools: remove unnecessary typename
This is acceptted by clang and gcc, but MSVC seems to balk at it.  As it is
unneeded, simply drop it.  Fixes MSVC buildbots.

llvm-svn: 200456
2014-01-30 06:19:24 +00:00
Saleem Abdulrasool
cfb7e2a038 tools: repair Windows build
exp2 is not available on Windows.  Fortunately, we are calculating powers of 2
with expontents within the range of [4,12].  Simply use an equivalent bitshift
operation to repair compilation with MSVC which does not provide this standard
function.

llvm-svn: 200454
2014-01-30 05:20:31 +00:00