search for: mcexpr

Displaying 20 results from an estimated 99 matches for "mcexpr".

2011 Oct 18
4
[LLVMdev] Question about MCExpr and subclasses
I have a question about MCExpr and its subclasses defined in MCExpr.h. I am trying to get Mips' direct object emission working. Line 283 of MCElfStreamer.cpp reads like this: 00283 case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!"); Does this mean that if I use a subclass of MCTargetExp...
2011 Oct 19
0
[LLVMdev] Question about MCExpr and subclasses
HI Akira, Please include the mailing list on replies. Using an MCExpr is the right way to build up things like symbol+offset. ARM has examples for that, as well, which may prove useful. For printing, the target libraries can do that however they want, including using the generic print method for expressions (or not). Often, the generic printing is sufficient, but no...
2011 Oct 18
0
[LLVMdev] Question about MCExpr and subclasses
...the normal MC stuff (for example, the ARM movw/movt relocations). You should be able represent normal symbol operands w/o needing a MCTargetExpr instance. The ARM or x86 targets may me useful reference points. -Jim On Oct 17, 2011, at 5:10 PM, Akira Hatanaka wrote: > I have a question about MCExpr and its subclasses defined in MCExpr.h. > I am trying to get Mips' direct object emission working. > > Line 283 of MCElfStreamer.cpp reads like this: > 00283 case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!"); > > Does this mean that if I...
2017 Oct 05
2
Conversion of const llvm::MCExpr * to string
Hello, I need the expression in string. How can i convert llvm::MCExpr * to string? Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171005/50817330/attachment.html>
2010 Jul 16
0
[LLVMdev] Win32 COFF Support - Patch 3
...Streamer.cpp b/lib/MC/WinCOFFStreamer.cpp > index 1030cdb..079a813 100644 > --- a/lib/MC/WinCOFFStreamer.cpp > +++ b/lib/MC/WinCOFFStreamer.cpp > @@ -18,24 +18,41 @@ > #include "llvm/MC/MCSection.h" > #include "llvm/MC/MCSymbol.h" > #include "llvm/MC/MCExpr.h" > +#include "llvm/MC/MCValue.h" > +#include "llvm/MC/MCAssembler.h" > +#include "llvm/MC/MCAsmLayout.h" > #include "llvm/MC/MCCodeEmitter.h" > #include "llvm/MC/MCSectionCOFF.h" > +#include "llvm/Target/TargetRegistr...
2010 Jul 14
2
[LLVMdev] Win32 COFF Support - Patch 3
On Sun, Jul 11, 2010 at 6:10 PM, Chris Lattner <clattner at apple.com> wrote: > This probably needs to be slightly tweaked to work with mainline.  I don't see anything objectionable, but I think Daniel needs to review this one. Updated patch to work with mainline. http://github.com/Bigcheese/llvm-mirror/commit/d19a4c82c18afc4830c09b70f02d162292231c94 - Michael Spencer
2015 Dec 14
3
Getting TargetLowering in AsmPrinter / Lowering constant addrspacecast
Hi, I'd like to add support for addrspacecast in initializers of global variables, at least for the trivial case. The trivial case is if TargetLowering::isNoopAddrSpaceCast(SrcAS, DestAS) returns true. In this case the MCExpr for the addrspacecast is the MCExpr of its first operand. It seems hard to obtain an instance of TargetLowering in AsmPrinter::lowerConstant(). Other methods in this class obtain it by calling `MF->getSubtarget().getTargetLowering()`. However, because MF is nullptr when lowering initializ...
2010 Oct 21
5
[LLVMdev] [llvm-commits] Fwd: Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes
> Also what is the preferred method for MC way of setting out subsection > sizes after the fact? I am guessing I need to use an MCFixup? > How do I get an MCExpr to evaluate a method for the subsection size? > Is there an equivalent use in the places using MCFixup? > Do I need to add a new subclass to MCExpr for doing this? > > JimG, can you please comment on the MachO specific parts in the > ARMAsmPrinter.cpp? Is there an example of a "...
2013 Nov 12
2
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
Hi David, Thanks for your efforts here. I have a few comments on your patch, although I realise it's still a work in progress. +class ConstantPool { + MCSymbol *Label; + typedef std::vector<const MCExpr*> EntryVecTy; Use a SmallVector here? + MCSymbol *getLabel() {return Label;} + size_t getNumEntries() {return Entries.size();} + const MCExpr *getEntry(size_t Num) {return Entries[Num];} These can be const. + int64_t ConstantPoolCounter; This can be unsigned. + case AsmToken::Equal: { +...
2010 Oct 21
0
[LLVMdev] [llvm-commits] Fwd: Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes
...in AsmPrinter, again to do cross platform things. It seems a bit strange to use a high level hammer to do ballpeen work..... But when in Rome.... :-) Also what is the preferred method for MC way of setting out subsection sizes after the fact? I am guessing I need to use an MCFixup? How do I get an MCExpr to evaluate a method for the subsection size? Is there an equivalent use in the places using MCFixup? Do I need to add a new subclass to MCExpr for doing this? JimG, can you please comment on the MachO specific parts in the ARMAsmPrinter.cpp? Is there an example of a "subsection size" th...
2010 Oct 21
3
[LLVMdev] [llvm-commits] Fwd: Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes
> Hmm, I wish we had this discussion way earlier.. > > How would I emit things in different subsections? I can do a high > level switch to .ARM.attributes, and if I were emitting one blob from > begin to end, using the higher level interface would be preferable, > but it contains additional subsections - which are naturally > represented by MCDataFragments - Is there an MC
2013 Nov 12
0
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
...o instruction in ARM > integrated assembler > > Hi David, > > Thanks for your efforts here. I have a few comments on your patch, > although I realise it's still a work in progress. > > +class ConstantPool { > + MCSymbol *Label; > + typedef std::vector<const MCExpr*> EntryVecTy; > > Use a SmallVector here? > > + MCSymbol *getLabel() {return Label;} > + size_t getNumEntries() {return Entries.size();} const MCExpr > + *getEntry(size_t Num) {return Entries[Num];} > These can be const. > > + int64_t ConstantPoolCounter; > T...
2012 Oct 17
0
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
...FStreamer() {} @@ -58,6 +60,7 @@ public: virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitAssemblerFlag(MCAssemblerFlag Flag); virtual void EmitThumbFunc(MCSymbol *Func); + virtual void EmitDataRegion(MCDataRegionType Kind); virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value); virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol); virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute); @@ -108,6 +111,7 @@ public: private: virtual void EmitInstToFragment(const MCInst &Inst); virtual void EmitInstToData(const...
2013 Nov 11
0
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
...hParse() callback to the target asm parser This callback is invoked when the parse has finished successfully. It will be used to write out constant pools for the ldr pseudo. LDR pseudo implementation Keep a map from Section => ConstantPool When parsing ldr r0, =val parse val as an MCExpr get ConstantPool for current Section remember val in ConstantPool (at next available Offset) add operand to ldr that is MCExpr of (ConstantPool.Label + Offset) On finishParse() callback Write out all non-empty constant pool vals to the end of their sections Missing features 1....
2013 Sep 25
1
[LLVMdev] arm64 / iOS support
...cpp index 7ce5ce3..e7c7f97 100644 --- a/lib/Target/AArch64/AArch64MCInstLower.cpp +++ b/lib/Target/AArch64/AArch64MCInstLower.cpp @@ -36,10 +36,16 @@ AArch64AsmPrinter::lowerSymbolOperand(const MachineOperand &MO, switch (MO.getTargetFlags()) { case AArch64II::MO_GOT: - Expr = AArch64MCExpr::CreateGOT(Expr, OutContext); + if (this->Subtarget->isTargetDarwin()) + Expr = AArch64MCExpr::CreateGOTDarwin(Expr, OutContext); + else + Expr = AArch64MCExpr::CreateGOT(Expr, OutContext); break; case AArch64II::MO_GOT_LO12: - Expr = AArch64MCExpr::CreateGOTLo12(Ex...
2014 Apr 08
2
[LLVMdev] 3.4.1 Release Plans
On Tue, Apr 08, 2014 at 04:08:13PM +0400, Robert Khasanov wrote: > Hi Reid, > > Would you approve your patches r203146 and r202774 to be backported to > 3.4.1? They fix stability issues in x86 asm. > Hi Robert, I was able to merge r203146, but it used a c++11 feature: std::string::back() which I replaced with std::string::at(std::string::size() - 1). r202774 was not merged,
2010 Oct 21
0
[LLVMdev] [llvm-commits] Fwd: Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes
On Thu, Oct 21, 2010 at 11:42 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote: >> Also what is the preferred method for MC way of setting out subsection >> sizes after the fact? I am guessing I need to use an MCFixup? >> How do I get an MCExpr to evaluate a method for the subsection size? >> Is there an equivalent use in the places using MCFixup? >> Do I need to add a new subclass to MCExpr for doing this? >> >> JimG, can you please comment on the MachO specific parts in the >> ARMAsmPrinter.cpp? Is there an...
2011 Apr 26
2
[LLVMdev] Symbol folding with MC
...var load retreg, a but i dont have an add with immediate instruction so i have to do the following subi a, -g_var // negate g_var addr load retreg, a A solution I thought could be passing a target flag indicating that a negation is needed when lowering the machineinstr into a MCInst, and adding a MCExpr to negate the symbol. But I want to know if there's a better way to do this, instead of delaying it to the stage of MCInst lowering. The other questions is how to fold single and complex operations on symbols, say we have something like: unsigned int g_var[80]; unsigned int foo() { return (un...
2012 Oct 16
2
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
Attached is an example of how to reproduce the issue. It uses a C file that happens to has a bunch of switch statements which are encoded as jump tables, giving us data-in-code. Usage: To build object files with clang via the -integrated-as versus via GCC: $ export NDK_DIR=<my_ndk_dir> $ export LLVM_DIR=<my_llvm_bin_dir> $ make To test that the generated objects contain the same
2010 Jul 27
3
[LLVMdev] Win32 COFF Support patch 5 (the final patch in the saga!)
...86AsmBackend.cpp b/lib/Target/X86/X86AsmBackend.cpp >> index 2cf65c1..02ac2be 100644 >> --- a/lib/Target/X86/X86AsmBackend.cpp >> +++ b/lib/Target/X86/X86AsmBackend.cpp >> @@ -14,6 +14,7 @@ >>  #include "llvm/MC/MCAssembler.h" >>  #include "llvm/MC/MCExpr.h" >>  #include "llvm/MC/MCObjectWriter.h" >> +#include "llvm/MC/MCSectionCOFF.h" >>  #include "llvm/MC/MCSectionELF.h" >>  #include "llvm/MC/MCSectionMachO.h" >>  #include "llvm/MC/MachObjectWriter.h" >> @@...