summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/llvm-mc.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-151-4/+4
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
* Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders2015-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and related. NFC. Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Thanks go to Pavel Labath for fixing LLDB for me. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247692
* Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders2015-09-151-4/+4
| | | | | | LLDB needs to be updated in the same commit. llvm-svn: 247686
* Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders2015-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
* [llvm-mc] Better error handling in ENOENT case + test.Davide Italiano2015-09-141-6/+1
| | | | | | | | | | | | | This is a follow up to r247518. As a general note, I think we could do a much better job testing for error conditions in tools. I already anticipated in a previous mail, but while implementing this I noticed that the code coverage we have for error checking is pretty low. I can arbitrarily remove checks from several tools and the suite still passes. Differential Revision: http://reviews.llvm.org/D12846 llvm-svn: 247582
* [llvm-mc] More meaningful error if input file doesn't exist.Davide Italiano2015-09-131-0/+5
| | | | | | | | | Before we just printed on stderr the program name. Now at least we print the name of the file that doesn't exist. There's probably room for improvement of error handling in llvm-mc (and the tools in general), but still this is a step forward. llvm-svn: 247518
* Use named temporaries for directional labels.Rafael Espindola2015-06-171-0/+3
| | | | | | | | | | Directional labels can show up in symbol tables (and we have a llvm-mc test for that). Given that, we need to make sure they are named. With that out of the way, use setUseNamesOnTempLabels in llvm-mc so that it too benefits from the memory saving. llvm-svn: 239914
* Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
* [llvm-mc] The object form of the GNU triple should be the same as the string ↵Daniel Sanders2015-06-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | form. Summary: GetTarget() may modify TripleName without also updating TheTriple. This can lead to situations where the MCObjectStreamer has a different triple to the rest of LLVM. This inconsistency caused sparc-little-endian.s to pass on Windows because most of LLVM had sparcel-pc-win32 while MCObjectStreamer had "". I believe the same kind of thing was also true of Darwin. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin, rafael Differential Revision: http://reviews.llvm.org/D10450 llvm-svn: 239808
* Revert r239721 - Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-151-4/+2
| | | | | | | | InitMCObjectFileInfo. NFC. It appears to cause sparc-little-endian.s to assert on Windows and Darwin. llvm-svn: 239724
* Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders2015-06-151-2/+4
| | | | | | | | | | | | | | | | | | | | | Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239721
* 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
* 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
* 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
* Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola2014-10-151-3/+4
| | | | 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
* 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-251-5/+5
| | | | 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
* 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
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-13/+12
| | | | | | | | | | 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
* 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
OpenPOWER on IntegriCloud