aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2013-04-05Fix include guards to match new location.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178877 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05Don't fetch pointers from a InMemoryStruct.Rafael Espindola
InMemoryStruct is extremely dangerous as it returns data from an internal buffer when the endiannes doesn't match. This should fix the tests on big endian hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178875 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05llvm-symbolizer: correctly parse filenames given in quotesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05Move obj2yaml to tools to sort out make's dependencies.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178835 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04Don't export symbols in every binary on linux.Rafael Espindola
On freebsd this makes sure that symbols are exported on the binaries that need them. The net result is that we should get symbols in the binaries that need them on every platform. On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB. Patch by Stephen Checkoway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178725 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Implements low-level object file format specific output for COFF andEric Christopher
ELF with support for: - File headers - Section headers + data - Relocations - Symbols - Unwind data (only COFF/Win64) The output format follows a few rules: - Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses. - Hex numbers are output in uppercase, prefixed with "0x". - Flags are sorted alphabetically. - Lists and groups are always delimited. Example output: ---------- snip ---------- Sections [ Section { Index: 1 Name: .text (5) Type: SHT_PROGBITS (0x1) Flags [ (0x6) SHF_ALLOC (0x2) SHF_EXECINSTR (0x4) ] Address: 0x0 Offset: 0x40 Size: 33 Link: 0 Info: 0 AddressAlignment: 16 EntrySize: 0 Relocations [ 0x6 R_386_32 .rodata.str1.1 0x0 0xB R_386_PC32 puts 0x0 0x12 R_386_32 .rodata.str1.1 0x0 0x17 R_386_PC32 puts 0x0 ] SectionData ( 0000: 83EC04C7 04240000 0000E8FC FFFFFFC7 |.....$..........| 0010: 04240600 0000E8FC FFFFFF31 C083C404 |.$.........1....| 0020: C3 |.| ) } ] ---------- snip ---------- Relocations and symbols can be output standalone or together with the section header as displayed in the example. This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated. Patch by Nico Rieck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178679 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Don't disassemble symbols with an unknown address or size.Eric Christopher
Patch by Nico Rieck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178678 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01pnacl-abicheck: Fix exit status so that 256 errors aren't reported as successMark Seaborn
Avoid truncation problems. On Unix, exit(256) is equivalent to exit(0). BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=none Review URL: https://codereview.chromium.org/13375007
2013-04-01PNaCl: Allow the ABI checker to be used from "opt"Mark Seaborn
This allows the ABI checker passes to be used in the same way as LLVM's "-verify" pass. It allows the checker to be run between other passes, and without launching pnacl-abicheck as a separate process (so without the overhead of reading bitcode into memory again). Make the ABI checker passes produce fatal errors by default, to match "-verify". This is overridden for pnacl-abicheck's use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=tested with pnacl-ld.py changes to use the ABI checker passes Review URL: https://codereview.chromium.org/13323006
2013-03-29Run the ObjCARCContract pass for LTO. <rdar://problem/13538084>Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28Add a pass to strip bitcode metadata.Jan Voung
This only works on instruction attachments for now. Since it is a ModulePass we can add something to strip NamedMetadata based on a whitelist, if we want to retain some of that. It does not touch debug metadata, and leaves -strip-debug to handle that. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3348 Review URL: https://codereview.chromium.org/12844027
2013-03-28Target Cortex-A9 with NEON in PNaCl's LLC driver.JF Bastien
This is a follow-up to: https://codereview.chromium.org/12683004/ https://codereview.chromium.org/12969002/ And will enable optiomizations for our minimum platform when translating with default flags. At some point we'll probably want to specialize further by detecting, e.g. A15 and turning on VFP4, IDIV, etc... R= dschuff@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/13224003
2013-03-27Make pnacl-abicheck return nonzero status if errors are found.Derek Schuff
Also add -q flag for quiet operation; i.e. don't print the errors, only use the exit status to indicate failure. R=mseaborn@chromium.org,jvoung@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309 Review URL: https://codereview.chromium.org/13117004
2013-03-26PNaCl: Add ExpandGetElementPtr pass for converting GetElementPtr to arithmeticMark Seaborn
This is similar to the GEP handling in visitGetElementPtr() in lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp. Once this pass is enabled, it will simplify the language to reduce the set of constructs that a PNaCl translator needs to handle as part of a stable wire format for PNaCl. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343 TEST=test/Transforms/NaCl/expand-getelementptr.ll Review URL: https://codereview.chromium.org/12849009
2013-03-26Manually update the dependencies in the Makefiles. It turns out that allChandler Carruth
that work on the LLVMBuild based dependency specification didn't actually work, we just now maintain dependencies in *3* places instead of 2. Yay. There may still be some missing dependencies, I'm still sifting through the bots and my builds, but this is a step in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177988 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Split out the IRReader header and the utility functions it provides intoChandler Carruth
its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25PNaCl ABI: add passes to cleanup/finalize some linkage types and resolve ↵Derek Schuff
aliases. R=mseaborn@chromium.org,eliben@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339 Review URL: https://codereview.chromium.org/13036005
2013-03-25Add -time-ir-parsing flag to llc.Eli Bendersky
This is in the process of being added upstream but the exact location is still debated and will take some time to settle. In the mean-time I'm adding it as a localmod so we can run our benchmarks effectively. Later this should be switched to the upstream implementation (or move to our own llc-replacement-driver). BUG=https://code.google.com/p/nativeclient/issues/detail?id=3349
2013-03-25[tools][llvm-readobj] print the name of the section when iterating the ↵Shankar Easwaran
symbol table / dynamic symbol table git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177873 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21PNaCl: Add ExpandVarArgs pass for expanding out variable-args function callsMark Seaborn
Once this pass is enabled, it will simplify the language to reduce the set of constructs that a PNaCl translator needs to handle as part of a stable wire format for PNaCl. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338 TEST=test/Transforms/NaCl/expand-varargs.ll Review URL: https://codereview.chromium.org/12481021
2013-03-20Merge remote-tracking branch 'origin/master'Eli Bendersky
Merge Nacl-LLVM work since the upstream merge branched
2013-03-19Remove stale commentEli Bendersky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Fix for r177390: map values are pointers, use DeleteContainerSeconds() ↵Alexey Samsonov
instead of .clear() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177409 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19llvm-symbolizer: flush internal caches functionalityDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177390 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-17Build LLVMgold.so on FreeBSD using cmake.Rafael Espindola
Patch by Stephen Checkoway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177233 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15PNaCl: Add ExpandConstantExpr pass for converting ConstantExprs to InstructionsMark Seaborn
Once this pass is enabled, it will simplify the language to reduce the set of constructs that a PNaCl translator needs to handle as part of a stable wire format for PNaCl. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3337 TEST=test/Transforms/NaCl/expand-constantexpr.ll Review URL: https://codereview.chromium.org/12792011
2013-03-14Fix CMakeFile as well.Derek Schuff
Carryover from https://codereview.chromium.org/12690007
2013-03-14Fix LLVMBuild.txt for NaCl analysis passesDerek Schuff
R=jvoung@chromium.org BUG= Sandboxed LLC doesn't build correctly anymore without it Review URL: https://codereview.chromium.org/12432018
2013-03-14Cleanup of ABI CheckerDerek Schuff
Fix spacing of error output, use OwningPtr everywhere at top level, fix command line parsing R=jvoung@chromium.org BUG= Review URL: https://codereview.chromium.org/12690007
2013-03-13ABI verifier: Add standalone tool pnacl-abicheckDerek Schuff
This CL adds a standalone tool pnacl-abicheck for checking the ABI validity of a bitcode file. It also adds a flag pnaclabi-verify to llc to enable the same checking in llc. It also improves the mechanism for handling and reporting validation errors and uses it in both tools. R=jvoung@chromium.org,mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309 Review URL: https://codereview.chromium.org/12449014
2013-03-13Make LTO codegen use a PassManager, rather than a FunctionPassManager, for theLang Hames
codegen passes. This brings it in to line with clang and llc's codegen setup, and tidies up the code. If I understand correctly, adding ModulePasses to a FunctionPassManager is bogus. It only seems to explode if an added ModulePass depends on a FunctionPass though, which might be why this code has survived so long. Fixes <rdar://problem/13386816>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11Merge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'Eli Bendersky
Conflicts: include/llvm/CodeGen/LexicalScopes.h include/llvm/MC/MCAsmInfo.h lib/Linker/LinkArchives.cpp lib/Linker/LinkItems.cpp lib/MC/MCAsmInfo.cpp lib/MC/MCDwarf.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMSubtarget.cpp lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp lib/Target/Mips/MipsAsmPrinter.cpp lib/Target/Mips/MipsDelaySlotFiller.cpp lib/Target/Mips/MipsISelDAGToDAG.cpp lib/Target/Mips/MipsSubtarget.cpp lib/Target/Mips/MipsSubtarget.h lib/Target/Mips/MipsTargetObjectFile.cpp lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86TargetMachine.cpp lib/Transforms/CMakeLists.txt lib/Transforms/LLVMBuild.txt lib/Transforms/Makefile test/MC/ARM/arm_instructions.s test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
2013-03-06Add an RPC to LLC.nexe to init with appended flags (vs set all flags).Jan Voung
This will take the default flags and append any extra flags. For now, this is only intended to support -O in the browser, and perhaps -mcpu=.*, -mattr=. We move the tuning parameters like -mcpu out of the default, so that a user does not end up setting the -mcpu more than once (which is disallowed). What does go into the default is -mtriple, which we may want to hard-code into the build somehow (but it's not yet clear how to do that cleanly). That way, a user does not need to specify that portion. We also hardcode the -sfi-* flags. Sort of tested by: https://codereview.chromium.org/12459004/ BUG= https://code.google.com/p/nativeclient/issues/detail?id=3325 Review URL: https://codereview.chromium.org/12490004
2013-02-28Connect LLVM CMake build scripts to LLDB's CMake scripts:Daniel Malea
- 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-28Add the -disable-opt option to LTO. This adds:Bill Wendling
- 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-27print TLS segmentShankar Easwaran
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176192 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Try to get rid of a -wunitialized warning: explicitly initialize the pointerEli Bendersky
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-26Fix auto_ptr is deprecated warningsMatt Arsenault
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Provide workaround for PR 15130.Andrew Kaylor
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-21[objdump] Add PT_PHDR.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175709 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20Explicitly set a buffer size for sandboxed llc's objfile.Jan Voung
Otherwise it is "buffered", but the buffer size is 0. Unbuffered writes add 1 second of sys time to translation time of gcc. With a large buffer, sys time is again near 0. BUG= http://code.google.com/p/nativeclient/issues/detail?id=3315 Review URL: https://codereview.chromium.org/12317019
2013-02-20[objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20[llvm-readobj] Add ELF .dynamic table dumping.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175592 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19Prune AsmParser (target and generic).Jan Voung
This is for the sandboxed llvm translator. Rough estimate, from companion test: https://codereview.chromium.org/12218141/ """ Pruned out approx 35099 bytes worth of MCAsmParser symbols Pruned out approx 49935 bytes worth of ::AsmParser symbols Pruned out approx 183308 bytes worth of ARMAsmParser symbols Pruned out approx 54552 bytes worth of X86AsmParser symbols Pruned out approx 11415 bytes worth of ELFAsmParser symbols Pruned out approx 7253 bytes worth of COFFAsmParser symbols Pruned out approx 18450 bytes worth of DarwinAsmParser symbols Pruned out approx 403 bytes worth of MCAsmLexer symbols Pruned out approx 7009 bytes worth of ::AsmLexer symbols Pruned out approx 359436 bytes worth of MatchTable symbols """ BUG= https://code.google.com/p/nativeclient/issues/detail?id=1222 Review URL: https://codereview.chromium.org/12218139
2013-02-15clang-formatize llvm-symbolizer codeAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14llvm-symbolizer: speedup symbol lookupDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Use 'RC_XBS' instead of 'RC_BUILDIT' to catch all times when it's built in ↵Bill Wendling
the Apple way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175069 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12llvm-sb: Remove non-streaming code path and write to file directly.Jan Voung
This avoids a use of the ParseIR/ParseIRFile API in the sandboxed translator. ParseIR and friends are flexible and handle LLVM .ll parsing. We only need to handle bitcode streams... By removing a use of ParseIR*, LTO will remove all LLParser-related code. Helps reduce the size of the sandboxed LLC by a couple hundred KB. Also, finally do the cleanup that makes the translator write to its output file directly, rather than writing to a string stream before finally writing the output to a file. May save a couple of MB of memory (size of the object file)... BUG= http://code.google.com/p/nativeclient/issues/detail?id=1222 Review URL: https://codereview.chromium.org/12224132
2013-02-12Add static cast to unsigned char whenever a character classification ↵Guy Benyei
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-12Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174976 91177308-0d34-0410-b5e6-96231b3b80d8