ParseAssemblyString change of behaviour

Hi,

when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a change of behaviour in ParseAssemblyString. For an interactive toplevel I am generating .ll source and feeding it into ParseAssemblyString like this:

Module* parsedModule = ParseAssemblyString( code, targetModule, &errorInfo );

where targetModule is the module I expect all the LLVM code to go. Until 2.1 the globals, types and functions in code where added to targetModule. Since 2.2 this does not happen anymore.

The documentation still states that targetModule is "A module to add the assembly too.". Is the new behaviour a bug? If not why has this been changed?

And most important for me: how do I work around this? I intend to copy the types, globals and functions from the newly parsed module into my other module. Is this feasible or is there another recommended way? (Using the LLVM API instead of generating .ll source is not really practical for me at this time)

Jan

Hi Jan,

I don't think that there is any intentional change here. It sounds like a bug.

-Chris

Hi,

here is a patch which fixes the bug for me. I'm not sure the format is right, I created it using git show (I started from the 2.4 source release, no svn version here). Let me know if you need some other format

HTH,
Jan

Hi,

when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a
change of behaviour in ParseAssemblyString. For an interactive
toplevel I am generating .ll source and feeding it into
ParseAssemblyString like this:

Hi Jan,

I don't think that there is any intentional change here. It sounds
like a bug.

-Chris

_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Original message:

llvm-2.4.patch (1.49 KB)