search for: evaluateasabsolute

Displaying 8 results from an estimated 8 matches for "evaluateasabsolute".

2015 Jun 29
2
[LLVMdev] Hwo to guess PC-relative offset
> De : Joerg Sonnenberger [mailto:joerg at britannica.bec.de] > > The basic idea is to still create a relocation on the MC level, but fix it up later. > You didn't say if your ISA is fixed or variable length, the former, can simplify > this quite bit. The constant island pass generally tries to address two issues: > (1) Merging of identical constants. > (2) Splitting the
2015 Jun 30
2
[LLVMdev] Hwo to guess PC-relative offset
> De : Joerg Sonnenberger [mailto:joerg at britannica.bec.de] > > Well, MCFixup is what a relocation is represented as internally. They get > resolved to a fixed value and replaced, if evaluateAsAbsolute is true. > Hi Joerg, Actually it fails to get resolved to a fixed value. When I compile to .o then objdump it I can see that a symbol holding the constant value was created in .rodata.cst4 section. Since it is not in .text section, it sound logical that llvm cannot resolved it at assemble tim...
2010 Jul 16
0
[LLVMdev] Win32 COFF Support - Patch 3
...unsigned AddrSpace) { > + unsigned AddrSpace) { > + VisitSymbols(Value); > + > + MCDataFragment *Fragment = new MCDataFragment(getSectionData()); > + > + assert(AddrSpace == 0); > + > + int64_t RawValue; > + > + if (Value->EvaluateAsAbsolute(RawValue)) { > + char const *pvalue = reinterpret_cast<char const *>(&RawValue); > + Fragment->getContents().append(pvalue, pvalue + Size); This isn't valid, it is not endian safe. You can copy the MCMachOStreamer::EmitValue implementation (which is endian safe, but as...
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
2012 Nov 29
2
[LLVMdev] [cfe-dev] UB in TypeLoc casting
Moving to LLVM dev to discuss the possibility of extending the cast infrastructure to handle this. On Tue, Nov 20, 2012 at 5:51 PM, John McCall <rjmccall at apple.com> wrote: > On Nov 18, 2012, at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote: >> TypeLoc casting looks bogus. >> >> TypeLoc derived types return true from classof when the dynamic type >>
2012 Nov 30
0
[LLVMdev] [cfe-dev] UB in TypeLoc casting
....cpp (revision 168949) +++ lib/MC/MCAssembler.cpp (working copy) @@ -336,7 +336,7 @@ } case MCFragment::FT_Org: { - MCOrgFragment &OF = cast<MCOrgFragment>(F); + const MCOrgFragment &OF = cast<MCOrgFragment>(F); int64_t TargetLocation; if (!OF.getOffset().EvaluateAsAbsolute(TargetLocation, Layout)) report_fatal_error("expected assembly-time absolute expression"); @@ -393,7 +393,7 @@ uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F); switch (F.getKind()) { case MCFragment::FT_Align: { - MCAlignFragment &AF = cast<MCAlignFrag...
2013 Sep 25
1
[LLVMdev] arm64 / iOS support
...+ report_fatal_error("FIXME: relocations to absolute targets " + "not yet implemented"); + } else { + // Resolve constant variables. + if (SD->getSymbol().isVariable()) { + int64_t Res; + if (SD->getSymbol().getVariableValue()->EvaluateAsAbsolute( + Res, Layout, Writer->getSectionAddressMap())) { + FixedValue = Res; + return; + } + } + + // Check whether we need an external or internal relocation. + if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, SD, +...
2018 Sep 28
3
error: expected memory with 32-bit signed offset
Hi, I want to encode Loongson ISA initially https://gist.github.com/xiangzhai/8ae6966e2f02a94e180dd16ff1cd60ac gslbx           $2,0($3,$4) It is equivalent to: dadd $1, $3, $4 lb $2,0($1) I just use  mem_simmptr  as the default value of  DAGOperand MO , because  MipsMemAsmOperand  use  parseMemOperand  to parse general  MemOffset  and only *one*  AnyRegister , for example: 0($1) But