aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-11-14Overhaul the TargetMachine and LLVMTargetMachine Classes (#111234)Matin Raayai1-286/+0
Following discussions in #110443, and the following earlier discussions in https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html, https://reviews.llvm.org/D38482, https://reviews.llvm.org/D38489, this PR attempts to overhaul the `TargetMachine` and `LLVMTargetMachine` interface classes. More specifically: 1. Makes `TargetMachine` the only class implemented under `TargetMachine.h` in the `Target` library. 2. `TargetMachine` contains target-specific interface functions that relate to IR/CodeGen/MC constructs, whereas before (at least on paper) it was supposed to have only IR/MC constructs. Any Target that doesn't want to use the independent code generator simply does not implement them, and returns either `false` or `nullptr`. 3. Renames `LLVMTargetMachine` to `CodeGenCommonTMImpl`. This renaming aims to make the purpose of `LLVMTargetMachine` clearer. Its interface was moved under the CodeGen library, to further emphasis its usage in Targets that use CodeGen directly. 4. Makes `TargetMachine` the only interface used across LLVM and its projects. With these changes, `CodeGenCommonTMImpl` is simply a set of shared function implementations of `TargetMachine`, and CodeGen users don't need to static cast to `LLVMTargetMachine` every time they need a CodeGen-specific feature of the `TargetMachine`. 5. More importantly, does not change any requirements regarding library linking. cc @arsenm @aeubanks
2024-09-24[clang] Add cc1 --output-asm-variant= to set output syntaxFangrui Song1-1/+3
2fcaa549a824efeb56e807fcf750a56bf985296b (2010) added cc1as option `-output-asm-variant` (untested) to set the output syntax. `clang -cc1as -filetype asm -output-asm-variant 1` allows AT&T input and Intel output (`AssemblerDialect` is also used by non-x86 targets). This patch renames the cc1as option (to avoid collision with -o) and makes it available for cc1 to set output syntax. This allows different input & output syntax: ``` echo 'asm("mov $1, %eax");' | clang -xc - -S -o - -Xclang --output-asm-variant=1 ``` Note: `AsmWriterFlavor` (with a misleading name), used to initialize MCAsmInfo::AssemblerDialect, is primarily used for assembly input, not for output. Therefore, `echo 'asm("mov $1, %eax");' | clang -x c - -mllvm --x86-asm-syntax=intel -S -o -`, which achieves a similar goal before Clang 19, was unintended. Close #109157 Pull Request: https://github.com/llvm/llvm-project/pull/109360
2024-09-23Fix memory leak in LLVMTargetMachine.cpp (#109610)abhishek-kaushik221-1/+3
Because `MAB` is a raw pointer, it could potentially leak memory because of the `||` in the null check.
2024-07-21[MC] Migrate to new createAsmStreamer that avoids unused bool parametersFangrui Song1-3/+1
2024-07-20[MC] MCAsmStreamer: use MCTargetOptionsFangrui Song1-15/+2
Some bool parameters duplicate MCTargetOptions and might cause inconsistency/confusion.
2024-07-20[MC] Remove unused bool arguments from createMCObjectStreamer callersFangrui Song1-6/+5
2024-07-20[MC] Remove unnecessary DWARFMustBeAtTheEnd checkFangrui Song1-6/+3
36a15cb975334403216e6145d4abece3026af17a introduced the DWARFMustBeAtTheEnd check to ensure DWARF sections were placed after all text sections to help avoid out-of-range branches for Darwin ARM. The commit removed a Darwin ARM hack from 20e5f5ed7930efdf2bd34bf099f24ac88798c5ea (2009), likely due to a no-longer-relevant assembler limitation. However, this check is no longer relevant due to the following: * Our CodeGen approach reliably places DWARF sections at the end. * Darwin AArch32 is less relevant today. Removing this check also addresses a minor clang cc1as crash that could occur when text sections were placed after DWARF sections (e9ad54b3ee905ea3a77c35ca7d6e843b2c552e0b (2015)).
2024-06-12[MC] Move AllowTemporaryLabels setting to MCContext::MCContextFangrui Song1-5/+0
Also delete `AllowTemporaryLabels = true` from MCContext::reset: when llc supports -save-temp-labels in the next change, this assignment should be removed to support -compile-twice.
2024-03-06[MC] Move CompressDebugSections/RelaxELFRelocations from ↵Fangrui Song1-4/+0
TargetOptions/MCAsmInfo to MCTargetOptions The convention is for such MC-specific options to reside in MCTargetOptions. However, CompressDebugSections/RelaxELFRelocations do not follow the convention: `CompressDebugSections` is defined in both TargetOptions and MCAsmInfo and there is forwarding complexity. Move the option to MCTargetOptions and hereby simplify the code. Rename the misleading RelaxELFRelocations to X86RelaxRelocations. llvm-mc -relax-relocations and llc -x86-relax-relocations can now be unified.
2023-11-06[PowerPC] Add an alias for -mregnames so that full register names used in ↵Stefan Pintilie1-0/+2
assembly. (#70255) This option already exists on GCC and so it is being added to LLVM so that we use the same option as them.
2023-09-22Add command line option --no-trap-after-noreturn (#67051)Matt Harding1-0/+7
Add the command line option --no-trap-after-noreturn, which exposes the pre-existing TargetOption `NoTrapAfterNoreturn`. This pull request was split off from this one: https://github.com/llvm/llvm-project/pull/65876
2023-09-14[NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes ↵Arthur Eubanks1-5/+5
(#66295) This will make it easy for callers to see issues with and fix up calls to createTargetMachine after a future change to the params of TargetMachine. This matches other nearby enums. For downstream users, this should be a fairly straightforward replacement, e.g. s/CodeGenOpt::Aggressive/CodeGenOptLevel::Aggressive or s/CGFT_/CodeGenFileType::
2023-04-12Fix Mem leak in LLVMTargetMachine.cppWang, Xin101-5/+6
If we go to line 302, with one of MCE or MAB is not nullptr, then we could leak mem here. Use unique_ptr to maintain these 2 pointer can avoid it. Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D148003
2022-06-12[MC][re-land] Omit DWARF unwind info if compact unwind is present where eligibleJez Ng1-0/+3
This reverts commit d941d597837d9e1405086f008c9bd6a71e7263c9. Differential Revision: https://reviews.llvm.org/D122258
2022-06-12Revert "[MC] Omit DWARF unwind info if compact unwind is present where eligible"Jez Ng1-3/+0
This reverts commit ef501bf85d8c869248e51371f0e74bcec0e7b229.
2022-06-12[MC] Omit DWARF unwind info if compact unwind is present where eligibleJez Ng1-0/+3
Previously, omitting unnecessary DWARF unwinds was only done in two cases: * For Darwin + aarch64, if no DWARF unwind info is needed for all the functions in a TU, then the `__eh_frame` section would be omitted entirely. If any one function needed DWARF unwind, then MC would emit DWARF unwind entries for all the functions in the TU. * For watchOS, MC would omit DWARF unwind on a per-function basis, as long as compact unwind was available for that function. This diff makes it so that we omit DWARF unwind on a per-function basis for Darwin + aarch64 as well. In addition, we introduce the flag `--emit-dwarf-unwind=` which can toggle between `always`, `no-compact-unwind` (only emit DWARF when CU cannot be emitted for a given function), and the target platform `default`. `no-compact-unwind` is particularly useful for newer x86_64 platforms: we don't want to omit DWARF unwind for x86_64 in general due to possible backwards compat issues, but we should make it possible for people to opt into this behavior if they are only targeting newer platforms. **Motivation:** I'm working on adding support for `__eh_frame` to LLD, but I'm concerned that we would suffer a perf hit. Processing compact unwind is already expensive, and that's a simpler format than EH frames. Given that MC currently produces one EH frame entry for every compact unwind entry, I don't think processing them will be cheap. I tried to do something clever on LLD's end to drop the unnecessary EH frames at parse time, but this made the code significantly more complex. So I'm looking at fixing this at the MC level instead. **Addendum:** It turns out that there was a latent bug in the X86 backend when `OmitDwarfIfHaveCompactUnwind` is naively enabled, which is not too surprising given that this combination has not been heretofore used. For functions that have unwind info that cannot be encoded with CU, MC would end up dropping both the compact unwind entry (OK; existing behavior) as well as the DWARF entries (not OK). This diff fixes things so that we emit the DWARF entry, as well as a CU entry with encoding `UNWIND_X86_MODE_DWARF` -- this basically tells the unwinder to look for the DWARF entry. I'm not 100% sure the `UNWIND_X86_MODE_DWARF` CU entry is necessary, this was the simplest fix. ld64 seems to be able to handle both the absence and presence of this CU entry. Ultimately ld64 (and LLD) will synthesize `UNWIND_X86_MODE_DWARF` if it is absent, so there is no impact to the final binary size. Reviewed By: davide, lhames Differential Revision: https://reviews.llvm.org/D122258
2022-06-03[llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFCFangrui Song1-3/+3
Some cl::ZeroOrMore were added to avoid the `may only occur zero or one times!` error. More were added due to cargo cult. Since the error has been removed, cl::ZeroOrMore is unneeded. Also remove cl::init(false) while touching the lines.
2022-04-26[NVPTX] Disable DWARF .file directory for PTXAndrew Savonichev1-2/+15
Default behavior for .file directory was changed in D105856, but ptxas (CUDA 11.5 release) refuses to parse it: $ llc -march=nvptx64 llvm/test/DebugInfo/NVPTX/debug-file-loc.ll $ ptxas debug-file-loc.s ptxas debug-file-loc.s, line 42; fatal : Parsing error near '"foo.h"': syntax error Added a new field to MCAsmInfo to control default value of UseDwarfDirectory. This value is used if -dwarf-directory command line option is not specified. Differential Revision: https://reviews.llvm.org/D121299
2022-03-16Cleanup codegen includesserge-sans-paille1-2/+0
This is a (fixed) recommit of https://reviews.llvm.org/D121169 after: 1061034926 before: 1063332844 Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D121681
2022-03-10Revert "Cleanup codegen includes"Nico Weber1-0/+2
This reverts commit 7f230feeeac8a67b335f52bd2e900a05c6098f20. Breaks CodeGenCUDA/link-device-bitcode.cu in check-clang, and many LLVM tests, see comments on https://reviews.llvm.org/D121169
2022-03-10Cleanup codegen includesserge-sans-paille1-2/+0
after: 1061034926 before: 1063332844 Differential Revision: https://reviews.llvm.org/D121169
2022-02-25mark getTargetTransformInfo and getTargetIRAnalysis as constJameson Nash1-1/+1
Seems like this can be const, since Passes shouldn't modify it. Reviewed By: wsmoses Differential Revision: https://reviews.llvm.org/D120518
2022-02-16[NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`Shao-Ce SUN1-4/+3
Reviewed By: skan Differential Revision: https://reviews.llvm.org/D119846
2022-02-16Revert "[NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`"Shao-Ce SUN1-3/+4
This reverts commit fe25c06cc5bdc2ef9427309f8ec1434aad69dc7a.
2022-02-16[NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`Shao-Ce SUN1-4/+3
For ten years, it seems that `MCRegisterInfo` is not used by any target. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D119846
2022-02-09Cleanup LLVMMC headersserge-sans-paille1-0/+1
There's a few relevant forward declarations in there that may require downstream adding explicit includes: llvm/MC/MCContext.h no longer includes llvm/BinaryFormat/ELF.h, llvm/MC/MCSubtargetInfo.h, llvm/MC/MCTargetOptions.h llvm/MC/MCObjectStreamer.h no longer include llvm/MC/MCAssembler.h llvm/MC/MCAssembler.h no longer includes llvm/MC/MCFixup.h, llvm/MC/MCFragment.h Counting preprocessed lines required to rebuild llvm-project on my setup: before: 1052436830 after: 1049293745 Which is significant and backs up the change in addition to the usual benefits of decreasing coupling between headers and compilation units. Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D119244
2021-10-08Move TargetRegistry.(h|cpp) from Support to MCReid Kleckner1-1/+1
This moves the registry higher in the LLVM library dependency stack. Every client of the target registry needs to link against MC anyway to actually use the target, so we might as well move this out of Support. This allows us to ensure that Support doesn't have includes from MC/*. Differential Revision: https://reviews.llvm.org/D111454
2021-07-02[AIX] Use AsmParser to do inline asm parsingJinsong Ji1-1/+5
Add a flag so that target can choose to use AsmParser for parsing inline asm. And set the flag by default for AIX. -no-intergrated-as will override this default if specified explicitly. Reviewed By: #powerpc, shchenz Differential Revision: https://reviews.llvm.org/D105314
2021-01-26Add -fbinutils-version= to gate ELF features on the specified binutils versionFangrui Song1-0/+3
There are two use cases. Assembler We have accrued some code gated on MCAsmInfo::useIntegratedAssembler(). Some features are supported by latest GNU as, but we have to use MCAsmInfo::useIntegratedAs() because the newer versions have not been widely adopted (e.g. SHF_LINK_ORDER 'o' and 'unique' linkage in 2.35, --compress-debug-sections= in 2.26). Linker We want to use features supported only by LLD or very new GNU ld, or don't want to work around older GNU ld. We currently can't represent that "we don't care about old GNU ld". You can find such workarounds in a few other places, e.g. Mips/MipsAsmprinter.cpp PowerPC/PPCTOCRegDeps.cpp X86/X86MCInstrLower.cpp AArch64 TLS workaround for R_AARCH64_TLSLD_MOVW_DTPREL_* (PR ld/18276), R_AARCH64_TLSLE_LDST8_TPREL_LO12 (https://bugs.llvm.org/show_bug.cgi?id=36727 https://sourceware.org/bugzilla/show_bug.cgi?id=22969) Mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER components (supported by LLD in D84001; GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=16833 may take a while before available). This feature allows to garbage collect some unused sections (e.g. fragmented .gcc_except_table). This patch adds `-fbinutils-version=` to clang and `-binutils-version` to llc. It changes one codegen place in SHF_MERGE to demonstrate its usage. `-fbinutils-version=2.35` means the produced object file does not care about GNU ld<2.35 compatibility. When `-fno-integrated-as` is specified, the produced assembly can be consumed by GNU as>=2.35, but older versions may not work. `-fbinutils-version=none` means that we can use all ELF features, regardless of GNU as/ld support. Both clang and llc need `parseBinutilsVersion`. Such command line parsing is usually implemented in `llvm/lib/CodeGen/CommandFlags.cpp` (LLVMCodeGen), however, ClangCodeGen does not depend on LLVMCodeGen. So I add `parseBinutilsVersion` to `llvm/lib/Target/TargetMachine.cpp` (LLVMTarget). Differential Revision: https://reviews.llvm.org/D85474
2020-12-29Reland "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen ↵Yuanfang Chen1-10/+25
pipeline" (again) This reverts commit 16c8f6e91344ec9840d6aa9ec6b8d0c87a104ca3 with fix. -Wswitch catched an unhandled enum value due to recent commits in TargetPassConfig.cpp.
2020-12-29Revert "Reland "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build ↵Yuanfang Chen1-25/+10
codegen pipeline"" This reverts commit 21314940c4856e0cb81b664fd2d2117d1b7dc3e3. Build failure in some bots.
2020-12-29Reland "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen ↵Yuanfang Chen1-10/+25
pipeline" This reverts commit 94427af60c66ffea655a3084825c6c3a9deec1ad (relands 4646de5d75cfce3da4ddeffb6eb8e66e38238800 with fix). Use "return std::move(AsmStreamer);" instead of "return AsmStreamer;" in LVMTargetMachine::createMCStreamer. Unlike Clang, GCC seems having trouble inserting a implicit lvalue->rvalue conversion.
2020-12-28Revert "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen ↵Yuanfang Chen1-25/+10
pipeline" This reverts commit 4646de5d75cfce3da4ddeffb6eb8e66e38238800. Some bots have build failure.
2020-12-28[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipelineYuanfang Chen1-10/+25
Following up on D67687. Please refer to the RFC here http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html `CodeGenPassBuilder` is the NPM counterpart of `TargetPassConfig` with below differences. - Debugging features (MIR print/verify, disable pass, start/stop-before/after, etc.) living in `TargetPassConfig` are moved to use PassInstrument as much as possible. (Implementation also lives in `TargetPassConfig.cpp`) - `TargetPassConfig` is a polymorphic base (virtual inheritance) to build the target-dependent pipeline whereas `CodeGenPassBuilder` is the CRTP base/helper to implement the target-dependent pipeline. The motivation is flexibility for targets to customize the pipeline, inlining opportunity, and fits the overall NPM value semantics design. - `TargetPassConfig` is a legacy immutable pass to declare hooks for targets to customize some target-independent codegen layer behavior. This is partially ported to TargetMachine::options. The rest, such as `createMachineScheduler/createPostMachineScheduler`, are left out for now. They should be implemented in LLVMTargetMachine in the future. Reviewed By: arsenm, aeubanks Differential Revision: https://reviews.llvm.org/D83608
2020-11-21[llvm][clang][mlir] Add checks for the return values from Target::createXXX ↵Ella Ma1-0/+3
to prevent protential null deref All these potential null pointer dereferences are reported by my static analyzer for null smart pointer dereferences, which has a different implementation from `alpha.cplusplus.SmartPtr`. The checked pointers in this patch are initialized by Target::createXXX functions. When the creator function pointer is not correctly set, a null pointer will be returned, or the creator function may originally return a null pointer. Some of them may not make sense as they may be checked before entering the function, but I fixed them all in this patch. I submit this fix because 1) similar checks are found in some other places in the LLVM codebase for the same return value of the function; and, 2) some of the pointers are dereferenced before they are checked, which may definitely trigger a null pointer dereference if the return value is nullptr. Reviewed By: tejohnson, MaskRay, jpienaar Differential Revision: https://reviews.llvm.org/D91410
2020-10-16[llc] Use -filetype=null to disable MIR printingJay Foad1-5/+8
If you use -stop-after or similar options, llc will normally print MIR. This patch checks for -filetype=null as a special case to disable MIR printing. As the comment says, "The Null output is intended for use for performance analysis ...", and I found this useful for timing a subset of the passes that llc runs without the significant overhead of printing MIR just to send it to /dev/null. Differential Revision: https://reviews.llvm.org/D89476
2020-09-11Revert "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen ↵Yuanfang Chen1-25/+10
pipeline" This reverts commit 31ecf8d29d81d196374a562c6d2bd2c25a62861e. This reverts commit 3fdaa8602a086a3fca5f0fc8527536ac659079d0. There is laying violation for Target->CodeGen.
2020-09-11[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipelineYuanfang Chen1-10/+25
Following up on D67687. Please refer to the RFC here http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html `CodeGenPassBuilder` is the NPM counterpart of `TargetPassConfig` with below differences. - Debugging features (MIR print/verify, disable pass, start/stop-before/after, etc.) living in `TargetPassConfig` are moved to use PassInstrument as much as possible. (Implementation also lives in `TargetPassConfig.cpp`) - `TargetPassConfig` is a polymorphic base (virtual inheritance) to build the target-dependent pipeline whereas `CodeGenPassBuilder` is the CRTP base/helper to implement the target-dependent pipeline. The motivation is flexibility for targets to customize the pipeline, inlining opportunity, and fits the overall NPM value semantics design. - `TargetPassConfig` is a legacy immutable pass to declare hooks for targets to customize some target-independent codegen layer behavior. This is partially ported to TargetMachine::options. The rest, such as `createMachineScheduler/createPostMachineScheduler`, are left out for now. They should be implemented in LLVMTargetMachine in the future. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D83608
2020-07-20[NFC] remove unneeded TargetLoweringObjectFile init after 85c30f3374d9Yuanfang Chen1-11/+2
2020-02-25[MC] Default MCContext::UseNamesOnTempLabels to false and only set it to ↵Fangrui Song1-3/+0
true for MCAsmStreamer Only MCAsmStreamer (assembly output) needs to keep names of temporary labels created by MCContext::createTempSymbol(). This change made the rL236642 optimization available for cc2as and probably some other users. This eliminates a behavior difference between llvm-mc -filetype=obj and cc1as, which caused https://reviews.llvm.org/D74006#1890487 Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D75097
2019-10-23[Mips] Use appropriate private label prefix based on Mips ABIMirko Brkusanin1-2/+2
MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64 regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo we can find out Mips ABI and pick appropriate prefix. Tags: #llvm, #clang, #lldb Differential Revision: https://reviews.llvm.org/D66795
2019-09-30[NewPM] Port MachineModuleInfo to the new pass manager.Yuanfang Chen1-16/+16
Existing clients are converted to use MachineModuleInfoWrapperPass. The new interface is for defining a new pass manager API in CodeGen. Reviewers: fedor.sergeev, philip.pfaffe, chandlerc, arsenm Reviewed By: arsenm, fedor.sergeev Differential Revision: https://reviews.llvm.org/D64183 llvm-svn: 373240
2019-08-15[llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere1-1/+1
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
2019-06-06[AIX] Implement function descriptor on SDAGJason Liu1-0/+9
Summary: (1) Function descriptor on AIX On AIX, a called routine may have 2 distinct symbols associated with it: * A function descriptor (Name) * A function entry point (.Name) The descriptor structure on AIX is the same as those in the ELF V1 ABI: * The address of the entry point of the function. * The TOC base address for the function. * The environment pointer. The descriptor symbol uses the same name as the source level function in C. The function entry point is analogous to the symbol we would generate for a function in a non-descriptor-based ABI, except that it is renamed by prepending a ".". Which symbol gets referenced depends on the context: * Taking the address of the function references the descriptor symbol. * Calling the function references the entry point symbol. (2) Speaking of implementation on AIX, for direct function call target, we create proper MCSymbol SDNode(e.g . ".foo") while constructing SDAG to replace original TargetGlobalAddress SDNode. Then down the path, we can take advantage of this MCSymbol. Patch by: Xiangling_L Reviewed by: sfertile, hubert.reinterpretcast, jasonliu, syzaara Differential Revision: https://reviews.llvm.org/D62532 llvm-svn: 362735
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-11-02LLVMTargetMachine/TargetPassConfig: Simplify handling of start/stop options; NFCMatthias Braun1-25/+21
- Make some TargetPassConfig methods that just check whether options have been set static. - Shuffle code in LLVMTargetMachine around so addPassesToGenerateCode only deals with TargetPassConfig now (but not with MCContext or the creation of MachineModuleInfo) llvm-svn: 345918
2018-09-25Use unique_ptr to hold AsmInfo,MRI,MII,STIFangrui Song1-5/+5
Reviewers: pcc, dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52389 llvm-svn: 342945
2018-05-21CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne1-5/+10
up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
2018-05-18MC: Change the streamer ctors to take an object writer instead of a stream. ↵Peter Collingbourne1-3/+5
NFCI. The idea is that a client that wants split dwarf would create a specific kind of object writer that creates two files, and use it to create the streamer. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47050 llvm-svn: 332749
2018-04-27[MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.Nirav Dave1-6/+6
llvm-svn: 331048