summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc
Commit message (Collapse)AuthorAgeFilesLines
...
* Teaching llvm-mc how to understand the defsym command line option. This ↵Colin LeMahieu2015-06-071-0/+26
| | | | | | allows integer-constant symbols to be defined on the command line and used during assembly. llvm-svn: 239240
* Add targets to cmake for specific target components.Pete Cooper2015-04-201-1/+5
| | | | | | | | | | | | This adds the following targets to cmake. These can be used to build and link only specific parts of a backend, instead of having to link the whole backend. - AllTargetsAsmPrinters, AllTargetsAsmParsers, AllTargetsDescs, AllTargetsDisassemblers, AllTargetsInfos A typical use for these is instead of linking ${LLVM_TARGETS_TO_BUILD}. This commit changes llvm-mc to show how to use the new targets. Reviewed by Chris Bieneman. llvm-svn: 235324
* Use raw_pwrite_stream in the object writer/streamer.Rafael Espindola2015-04-141-3/+11
| | | | | | The ELF object writer will take advantage of that in the next commit. llvm-svn: 234950
* Simplify use of formatted_raw_ostream.Rafael Espindola2015-04-091-6/+6
| | | | | | | | | | | | | | | formatted_raw_ostream is a wrapper over another stream to add column and line number tracking. It is used only for asm printing. This patch moves the its creation down to where we know we are printing assembly. This has the following advantages: * Simpler lifetime management: std::unique_ptr * We don't compute column and line number of object files :-) llvm-svn: 234535
* Replace the MCSubtargetInfo parameter with a Triple when creatingEric Christopher2015-03-311-2/+2
| | | | | | | an MCInstPrinter. Update all callers and use where we wanted a Triple previously. llvm-svn: 233648
* Don't declare all text sections at the start of the .sRafael Espindola2015-03-201-1/+2
| | | | | | | | | | | | | | | | | The code this patch removes was there to make sure the text sections went before the dwarf sections. That is necessary because MachO uses offsets relative to the start of the file, so adding a section can change relaxations. The dwarf sections were being printed at the start just to produce symbols pointing at the start of those sections. The underlying issue was fixed in r231898. The dwarf sections are now printed when they are about to be used, which is after we printed the text sections. To make sure we don't regress, the patch makes the MachO streamer assert if CodeGen puts anything unexpected after the DWARF sections. llvm-svn: 232842
* Pass in a "const Triple &T" instead of a raw StringRef.Rafael Espindola2015-03-161-1/+2
| | | | llvm-svn: 232429
* Remove the use of the subtarget in MCCodeEmitter creation andEric Christopher2015-03-101-2/+2
| | | | | | | update all ports accordingly. Required a couple of small rewrites in handling subtarget features during creation in PPC. llvm-svn: 231861
* llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific ↵Peter Collingbourne2015-02-191-1/+1
| | | | | | asm directives. llvm-svn: 229798
* Remove unused includes and out of date comment. NFC.Rafael Espindola2014-12-171-1/+0
| | | | llvm-svn: 224413
* Pass output stream to AsLexInput instead of the whole tool_output_file.Craig Topper2014-12-121-46/+46
| | | | llvm-svn: 224109
* Use unique_ptr to remove an explicit delete. Change return type to pass the ↵Craig Topper2014-12-121-5/+4
| | | | | | unique_ptr to caller. llvm-svn: 224108
* Remove the now unused StringRefMemoryObject.h.Rafael Espindola2014-11-121-1/+0
| | | | llvm-svn: 221755
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-121-3/+2
| | | | | | | | | | | | With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
* [llvm-mc] Fixing case where if a file ended with non-newline whitespace or a ↵Colin LeMahieu2014-11-111-15/+9
| | | | | | | | comma it would access invalid memory. Cleaned up parse loop. llvm-svn: 221707
* Use StringRefMemoryObject in llvm-mc. NFC.Rafael Espindola2014-11-071-29/+15
| | | | llvm-svn: 221536
* Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola2014-10-152-4/+5
| | | | llvm-svn: 219799
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-4/+4
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-211-2/+2
| | | | | | std::unique_ptr llvm-svn: 216223
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-5/+5
| | | | llvm-svn: 212405
* This only needs a StringRef.Rafael Espindola2014-07-061-1/+1
| | | | llvm-svn: 212401
* SourceMgr: make valid buffer IDs start from oneAlp Toker2014-07-061-1/+1
| | | | | | | | | | Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned representation to enable more idiomatic usage. Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1 to identify the main file. llvm-svn: 212398
* Simplify code a bit, no functionality change.Rafael Espindola2014-06-281-3/+3
| | | | llvm-svn: 211985
* Move -dwarf-version to an MC level command line option so it'sEric Christopher2014-06-191-7/+7
| | | | | | | used by all of the MC level tools and codegen. Fix up all uses in the compiler to use this and set it on the context accordingly. llvm-svn: 211257
* 80-column fixups.Eric Christopher2014-06-191-5/+10
| | | | llvm-svn: 211255
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-2/+2
| | | | llvm-svn: 210876
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* llvm-mc: Add option for prefering hex format disassembly.Jim Grosbach2014-06-111-9/+9
| | | | | | | | | Previously there was a separate mode entirely (--hdis vs. --disassemble). It makes a bit more sense for the immediate printing style to be a flag for --disassmeble rather than an entirely different thing. llvm-svn: 210700
* Move MCOptions that aren't shared between programs into their specificEric Christopher2014-05-211-0/+3
| | | | | | program and have them initialize the MCOptions struct explicitly. llvm-svn: 209321
* This command line option is only used in one place. Move it there andEric Christopher2014-05-211-0/+3
| | | | | | rename it to something more descriptive. llvm-svn: 209263
* Unify command line handling of MCTargetOptions and remove extraEric Christopher2014-05-151-9/+0
| | | | | | options and code. No functional change. llvm-svn: 208833
* Remove the UseCFI option from createAsmStreamer.Rafael Espindola2014-05-071-3/+2
| | | | | | We were already always passing true, this just removes the option. llvm-svn: 208205
* Record the DWARF version in MCContextOliver Stannard2014-05-011-0/+9
| | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-252-6/+6
| | | | llvm-svn: 207176
* Create MCTargetOptions.Evgeniy Stepanov2014-04-231-2/+5
| | | | | | | | | For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. llvm-svn: 206971
* [MC] Require an MCContext when constructing an MCDisassembler.Lang Hames2014-04-151-1/+21
| | | | | | | | | | | | | | | | This patch re-introduces the MCContext member that was removed from MCDisassembler in r206063, and requires that an MCContext be passed in at MCDisassembler construction time. (Previously the MCContext member had been initialized in an ad-hoc fashion after construction). The MCCContext member can be used by MCDisassembler sub-classes to construct constant or target-specific MCExprs. This patch updates disassemblers for in-tree targets, and provides the MCRegisterInfo instance that some disassemblers were using through the MCContext (previously those backends were constructing their own MCRegisterInfo instances). llvm-svn: 206241
* Add missing include (for r205050)David Blaikie2014-03-281-0/+1
| | | | llvm-svn: 205053
* llvm-mc: error when -compress-debug-sections is requested and zlib is not linkedDavid Blaikie2014-03-281-1/+6
| | | | | | | | | | This is a bit of a stab in the dark, since I have zlib on my machine. Just going to bounce it off the bots & see if it sticks. Do we have some convention for negative REQUIRES: checks? Or do I just need to add a feature like I've done here? llvm-svn: 205050
* DebugInfo: Support for compressed debug info sectionsDavid Blaikie2014-03-271-0/+6
| | | | | | | | | | | | | | | | | | | 1) When creating a .debug_* section and instead create a .zdebug_ section. 2) When creating a fragment in a .zdebug_* section, make it a compressed fragment. 3) When computing the size of a compressed section, compress the data and use the size of the compressed data. 4) Emit the compressed bytes. Also, check that only if a section has a compressed fragment, then that is the only fragment in the section. Assert-fail if the fragment's data is modified after it is compressed. Initial review on llvm-commits by Eric Christopher and Rafael Espindola. llvm-svn: 204958
* Remove llvm-mc's disable-cfi option.Rafael Espindola2014-03-201-7/+4
| | | | | | It was dead. llvm-svn: 204404
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-081-3/+3
| | | | | | class. llvm-svn: 203345
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-062-15/+13
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-1/+1
| | | | llvm-svn: 202957
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-1/+1
| | | | | | | | | 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
* Remove support for not using .loc directives.Rafael Espindola2014-02-051-5/+3
| | | | | | Clang itself was not using this. The only way to access it was via llc. llvm-svn: 200862
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-281-3/+4
| | | | llvm-svn: 200345
* Pass a MCSubtargetInfo down to the TargetStreamer creation.Rafael Espindola2014-01-261-1/+1
| | | | | | | With this the target streamers will be able to know the target features that are in use. llvm-svn: 200135
* Whitespace.NAKAMURA Takumi2014-01-221-1/+1
| | | | llvm-svn: 199785
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-101-1/+6
| | | | llvm-svn: 196908
OpenPOWER on IntegriCloud