Normally for int n unknown at static time, "a[n]" and "*(a+n)" results in an add and then a dereference. I want instead for it to compile to a system call that takes two arguments, a and n. Where should I intercept this in LLVM? Gry
Far too late. That would need to be in Clang. On Wed, Apr 8, 2015 at 5:36 PM, Gry Gunvor <gry.gunvor at gmail.com> wrote:> Normally for int n unknown at static time, "a[n]" and "*(a+n)" results > in an add and then a dereference. I want instead for it to compile to > a system call that takes two arguments, a and n. Where should I > intercept this in LLVM? > > Gry > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150408/e79ae002/attachment.html>
If I understand correctly, LLVM is a *typed* assembly language. Could I just look for a pointer type plus an integer type followed by a dereference? That would catch both a[n] and *(a+n). Gry On Tue, Apr 7, 2015 at 10:46 PM, Bruce Hoult <bruce at hoult.org> wrote:> Far too late. That would need to be in Clang. > > On Wed, Apr 8, 2015 at 5:36 PM, Gry Gunvor <gry.gunvor at gmail.com> wrote: >> >> Normally for int n unknown at static time, "a[n]" and "*(a+n)" results >> in an add and then a dereference. I want instead for it to compile to >> a system call that takes two arguments, a and n. Where should I >> intercept this in LLVM? >> >> Gry >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Possibly Parallel Threads
- [LLVMdev] want to intercept array dereferences
- [LLVMdev] [cfe-dev] want to intercept array dereferences
- [LLVMdev] how much RAM do I really need to build a devel version of LLVM?
- Fwd: getting started changing the emitted code: at one instruction at function top
- [LLVMdev] MOS6502 target