Displaying 20 results from an estimated 30000 matches similar to: "Why can't clang -emit-llvm when linking?"
2016 May 30
0
Why can't clang -emit-llvm when linking?
There is no single LLVM IR for the entire compilation process in such a
command line - separate IR is created for each source file, an object file
is created, then those (native, non-IR) object files are linked together.
So it's somewhat a invalid concept.
In your case, since there's only one file anyway, just add -c and you
should be fine (your IR won't include the standard
2016 May 30
1
Why can't clang -emit-llvm when linking?
I know right, but if I do -emit-llvm clang will emit an IR module as .ll file for each source I give him. So why can't it just emit the modules for the sources and then continue the compilation? I don't get the point of this error. Just for curiosity
> On May 30, 2016, at 6:17 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> There is no single LLVM IR for the entire
2016 Apr 14
2
Little explanation of this behaviour
I tried to emit IR for a function that returns the sum between an signed char and a double in C++, just to see how Clang handles type implicit casting.
Can you explain me why Clang converted the char type into a 32-bit integer type before casting it to a floating point? Can a sitofp i8 %3 to double be done or is it wrong?
define i32 @_Z5sumad(i8 signext %x, double %y) #0 {
%1 = alloca i8,
2016 Mar 24
2
Help with pass manager
So we come back to my earlier comment: can you produce a one-file, < 100 lines that reproduce the issue?
--
Mehdi
> On Mar 24, 2016, at 10:16 AM, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> Those lines of code are in a function that is called before calling the moduleToObjectFile() function
>
> On Mar 24, 2016, at 6:07 PM, Mehdi Amini <mehdi.amini at
2016 Mar 24
2
Help with pass manager
You may want to try adding this code (copy/pasted from llc.cpp):
// Initialize targets first, so that --version shows registered targets.
InitializeAllTargets();
InitializeAllTargetMCs();
InitializeAllAsmPrinters();
InitializeAllAsmParsers();
// Initialize codegen and IR passes used by llc so that the -print-after,
// -print-before, and -stop-after options work.
PassRegistry
2016 Mar 24
2
Help with pass manager
I’m using LLVM 3.8.0, and no, it’s the precompiled version
That’s why it doesn’t give me enough info for debug
> On 24 Mar 2016, at 1:53 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
> This code path is not likely to crash usually. Did you build LLVM yourself? Which version are you using and can you reduce the test case to be "minimal" so that someone can
2016 Mar 30
1
Help with pass manager
Passes all need to be initialized before they are added into a pass manager.
Are you calling TargetLibraryInfoWrapperPass::initializePass anywhere?
-Chris
> On Mar 24, 2016, at 10:41 AM, Lorenzo Laneve via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> The problems happens because PMTopLevelManager::findAnalysisPassInfo(AnalysisID AID) returns nullptr in
2016 Mar 24
0
Help with pass manager
Those lines of code are in a function that is called before calling the moduleToObjectFile() function
> On Mar 24, 2016, at 6:07 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
> You may want to try adding this code (copy/pasted from llc.cpp):
>
> // Initialize targets first, so that --version shows registered targets.
> InitializeAllTargets();
>
2016 Mar 24
0
Help with pass manager
The problems happens because PMTopLevelManager::findAnalysisPassInfo(AnalysisID AID) returns nullptr in PMTopLevelManager::addImmutablePass(ImmutablePass *P).
This because PassRegistry::getPassRegistry()->getPassInfo(AID) call in it returns nullptr as well.
Should I probably register the pass I want to add with PassRegistry::registerPass(const PassInfo &PI, bool ShouldFree) ?
I didn’t do it
2016 Mar 19
3
Need help with code generation
I'd like to make my compiler independent, just like Clang. Doesn't Clang call llc and then system's ld by itself? I don't want my compiler to depend by any other program.
I guess there will be a class in the llvm library that generates the object files based on the system's triple and data layout, and then call the system's ld?
> On Mar 19, 2016, at 11:48 AM, Bruce
2016 Jul 19
5
A "Java Backend"
My idea was to create a complete backend treating Java as a normal platform, to enable LLVM to compile programs to Java Bytecode (.class) and Java Archive files (.jar). This could be useful in situations where we need to compile a program for a platform still not natively supported by LLVM.
I don't know if it exists already, I've heard about this "LLJVM" but I don't think it
2016 Mar 24
0
Help with pass manager
Update:
Sorry my bad. I built llvm and tried it with debugging version.
It was an assertion (IR/LegacyPassManager.cpp:764) saying that it expects all immutable passes to be initialized.
> On Mar 24, 2016, at 2:00 AM, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> I’m using LLVM 3.8.0, and no, it’s the precompiled version
> That’s why it doesn’t give me enough info for
2016 Mar 20
2
Need help with code generation
Adding back the "all recipients" - sorry, sending message from my phone, I
forgot...
Since my runtime is for a Pascal compiler, it has to "adapt" the C startup
into a suitable Pascal environment. This means running the init portion of
other modules as well as discarding the argc, argv arguments. So, I have a
C main, which calls __PascalMain, which is the "main" for
2016 Mar 21
2
Need help with code generation
On Sat, Mar 19, 2016 at 9:51 PM, James Molloy via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hi Lorenzo,
>
> Clang doesn't call llc; LLVM is compiled into Clang. Clang does call the
> system linker though.
>
> Making your compiler generate *object* code is very simple. Making it
> fixup that object code and execute it in memory (JIT style) is also simple.
>
2016 Mar 19
2
Need help with code generation
If you plan on calling C runtime library functions, you probably want to do
what I did:
Cheat, and make a libruntime.a (with C functions to do stuff your compiler
can't do natively) and then link that using clang or gcc.
https://github.com/Leporacanthicus/lacsap/blob/master/binary.cpp#L124
At some point, I plan to replace my runtime library with native Pascal
code, at which point I will be
2016 May 23
3
A "Cross-Platform Runtime Library API" in LLVM IR
On 23 May 2016, at 12:00, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> This is the point,
No, you are still failing to make a point.
> High-level OO languages don't use malloc(), they use something else.
That’s not entirely true. They need to get the memory that they provide to programs from somewhere. They may provide their own pool allocators, but they will often
2016 Mar 24
2
Help with pass manager
Sorry, that's a pure crash I think, assertions are not triggered.
Xcode doesn’t map those 2 functions to line numbers because they’re in precompiled libraries
On Mar 24, 2016, at 1:44 AM, Mehdi Amini <mehdi.amini at apple.com <mailto:mehdi.amini at apple.com>> wrote:
>
>> On Mar 23, 2016, at 5:41 PM, Lorenzo Laneve <lore97drk at icloud.com <mailto:lore97drk at
2016 May 23
3
A "Cross-Platform Runtime Library API" in LLVM IR
On 23 May 2016, at 12:16, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> I'm not talking about a new library instead of the libc, I'm talking about letting people create a library optimized for a specific frontend, regardless of the target.
It sounded as if you were talking about a library that sits underneath such a thing. Lots of languages have their own runtime
2016 Mar 21
3
Need help with code generation
On Mon, Mar 21, 2016 at 8:04 PM, James Molloy <james at jamesmolloy.co.uk>
wrote:
> > A corrupted file could cause a fatal error or SEGV.
>
> Uhhh, that's not particularly useful.
>
"Corrupted" means really corrupted, like ELF header is broken. Is this
really the case?
> On Mon, 21 Mar 2016 at 19:02 Rui Ueyama <ruiu at google.com> wrote:
>
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
I'm not talking about a new library instead of the libc, I'm talking about letting people create a library optimized for a specific frontend, regardless of the target.
> On May 23, 2016, at 1:06 PM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
>
>> On 23 May 2016, at 12:00, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>>
>> This is the