Commit Graph

4090 Commits

Author SHA1 Message Date
Daniel Malea
39d994c78b Connect LLVM CMake build scripts to LLDB's CMake scripts:
- if you have LLDB checked out in $llvm/tools, CMake will build it now!
- LLDB is known to build on Linux with libstdc++ and GCC 4.6/4.7 or Clang 3.3
- to run lldb tests, do "make check-lldb" after a build



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176307 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 23:15:15 +00:00
Bill Wendling
6303b661b3 Add the -disable-opt option to LTO. This adds:
- Consistency with opt (which supports the same option with the same meaning and
  description).
- Debugging gold plugin-based linking without optimizations getting in the way.
- Debugging programs linked with the gold plugin while preserving the original
  debug info.
- Fine-grained control over LTO passes using the gold plugin in combination with
  opt (or clang/dragonegg).

Patch by Cristiano Giuffrida!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 14:11:10 +00:00
Shankar Easwaran
512685dacf print TLS segment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176192 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27 17:57:17 +00:00
Eli Bendersky
533048228f Try to get rid of a -wunitialized warning: explicitly initialize the pointer
to NULL and use asserts to check in relevant places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176134 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 23:04:17 +00:00
Matt Arsenault
7375f4f981 Fix auto_ptr is deprecated warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 21:20:35 +00:00
Andrew Kaylor
b90cc2fa0b Provide workaround for PR 15130.
This changes the RecordingMemoryManager in lli to use mapped memory rather than malloc to allocate memory for sections and uses a 'near' MemoryBlock to keep the allocations together.  This works around a problem in MCJIT where relocations are applied to a generated image immediately oupon generation, which isn't appropriate for the remote case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176057 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25 23:00:19 +00:00
Michael J. Spencer
561823009b [objdump] Add PT_PHDR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175709 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 02:21:29 +00:00
Michael J. Spencer
8a3a1deed8 [objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 20:18:10 +00:00
Michael J. Spencer
d326d05fb9 [llvm-readobj] Add ELF .dynamic table dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175592 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 02:37:12 +00:00
Alexey Samsonov
c4439c3508 clang-formatize llvm-symbolizer code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 08:54:47 +00:00
Dmitry Vyukov
b181919d86 llvm-symbolizer: speedup symbol lookup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 13:06:18 +00:00
Bill Wendling
ee740ddf9d Use 'RC_XBS' instead of 'RC_BUILDIT' to catch all times when it's built in the Apple way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175069 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 19:44:08 +00:00
Guy Benyei
87d0b9ed14 Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 21:21:59 +00:00
Krzysztof Parzyszek
e38825f490 Add support for the pubnames section to llvm-dwarfdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 16:20:28 +00:00
Bill Wendling
8620bd3178 Update with attribute group IDs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 23:17:10 +00:00
Michael J. Spencer
dc0f8a3fd9 [readobj] Fix memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08 01:05:48 +00:00
Eli Bendersky
60bdc5b16e Initial support for DWARF CFI parsing and dumping in LLVM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174463 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 23:30:58 +00:00
Michael J. Spencer
dd3aa9eab2 [objdump,readobj] Document the purpose and goals of each tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174439 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 20:27:22 +00:00
Alexey Samsonov
933b851485 Print error messages from MemoryBuffer::getFile() in llvm-symbolizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174346 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 07:01:34 +00:00
Alexey Samsonov
638c63ccf7 Replace global std::string with const char[]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 15:55:26 +00:00
Michael J. Spencer
0f76e648d8 [Object][Archive] Improve performance.
Improve performance of iterating over children and accessing the member file
buffer by caching the file size and moving code out to the header.

This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both
fixing a memory leak and removing a malloc.

This takes getBuffer from ~10% of the time in lld to unmeasurable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174272 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-03 10:48:50 +00:00
Chandler Carruth
03c209733b 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
2013-01-31 23:34:47 +00:00
Chandler Carruth
5da3665cc5 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
2013-01-31 23:29:57 +00:00
Andrew Kaylor
710cb0c782 Add support for source and line information to IntelJITEventListener for object emitted by MCJIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173712 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 19:52:37 +00:00
Michael Gottesman
24c4898973 Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 01:35:51 +00:00
Andrew Kaylor
e27a787760 Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173537 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:28:05 +00:00
Andrew Kaylor
ee7c0d2f93 Add support for applying in-memory relocations to the .debug_line section and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:50:58 +00:00
Eli Bendersky
a965baca3c When encountering an unknown file format, ObjectFile::createObjectFile should
politely report it instead of running into llvm_unreachable.

Also patch llvm-dwarfdump to actually check whether the file it's attempting to
dump is a valid object file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 20:53:41 +00:00
Eli Bendersky
939a4e8b69 Add command-line flags for DWARF dumping.
Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173480 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 20:26:43 +00:00
Eli Bendersky
172d5978c8 Rename variable to be more comprehensible and follow naming convention
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 17:06:42 +00:00
Saleem Abdulrasool
ed7fcf4fd9 [bugpoint] make tool selection messages unique
Change messages to help identify which interpreter was actually selected (safe
vs testing).

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 16:49:14 +00:00
Saleem Abdulrasool
78d3097263 [bugpoint] set Message after tool configuration
Set the message returned after the GCC runner has been constructed as otherwise
the message will be overwritten by the construction of the runner, resulting in
misleading messages.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 16:49:12 +00:00
NAKAMURA Takumi
5bac013d61 lli/RecordingMemoryManager: Free allocated sections in the destructor to satisfy --vg-leak!
FIXME: It could be generalized in MemoryManager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 14:12:12 +00:00
Alexey Samsonov
c4c7ea3184 llvm-symbolizer: factor out bits of the tool into separate LLVMSymbolize.{h,cpp} files. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173159 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 14:21:19 +00:00
Tim Northover
f65dc6e347 Fix missed out llvm-stress after APFloat change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173141 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 10:18:26 +00:00
NAKAMURA Takumi
7511aab27b [CMake] bugpoint-passes should not be built in "all", when LLVM_BUILD_TOOLS is OFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173112 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 01:44:00 +00:00
Jakub Staszak
3c8da314f1 Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 21:02:47 +00:00
Chris Lattner
4156ca76e3 switch llvm-bcanalyzer onto the new cursor APIs, allowing deletion of
the old ReadRecord methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:50:32 +00:00
Chris Lattner
bc837200eb fix method name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 21:37:14 +00:00
Chandler Carruth
90230c8466 Sort all of the includes. Several files got checked in with mis-sorted
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172891 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:03:47 +00:00
Daniel Dunbar
a94c339423 [MC/Mach-O] Add support for linker options in Mach-O files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 01:26:07 +00:00
Eli Bendersky
be2afb6408 Remove unneeded include and empty line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 19:42:16 +00:00
Kevin Enderby
75c9b9384f We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is the first of two steps to allow us to do that.  This is the llvm-mc
change to provide a method to set the AT_producer string.  The second step,
coming soon to a clang near you, will have the clang driver pass the value
of getClangFullVersion() via an flag when invoking the integrated assembler
on assembly source files.

rdar://12955296


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172630 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 17:46:23 +00:00
Peter Collingbourne
fbb662f840 Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time.  This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.

Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it.  On architectures with a
single bitness, the host and process triples are identical.  On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.

This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 17:27:22 +00:00
Michael J. Spencer
ac97f5ce48 [Object][ELF] Simplify ELFObjectFile by using ELFType.
This simplifies the usage and implementation of ELFObjectFile by using ELFType
to replace:

<endianness target_endianness, std::size_t max_alignment, bool is64Bits>

This does complicate the base ELF types as they must now use template template
parameters to partially specialize for the 32 and 64bit cases. However these
are only defined once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 07:44:25 +00:00
Nadav Rotem
1c1ff3b7ff LTO: Also init TTI for codegen passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172499 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 01:53:57 +00:00
Eli Bendersky
030f63a397 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
2013-01-14 19:04:57 +00:00
Andrew Trick
a125cacf7d Added -view-callgraph module pass.
-dot-callgraph similarly follows a standard module pass pattern.

Patch by Speziale Ettore!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 17:28:14 +00:00
Dmitry Vyukov
fc183ceae3 llvm-symbolizer: add DATA command that allows to symbolize global variables.
Example:
>DATA bin/clang 0x26e8e40
<llvm::SparcSubTypeKV
<40799808 416
The last line is address and size of the object.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 07:16:20 +00:00
Michael J. Spencer
27b2b1b4e5 [llvm-objdump] Emit addresses with the correct number of leading 0's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172130 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:40:50 +00:00