I ran cmake to build the visual studio projects. Then I included my code under the Visual Studio interface, but I placed my code separate from the CodeGen code. Visual studio was smart enough to compile and link in my code into the CodeGen library. Thus, I did not need to add my code into the same directory as the CodeGen files, and I did not need to change the CMakeList.txt. The offical name is LLVMCodeGen. However, the "opt.obj" and "bugpoint.obj" cannot find the reference function "llvm::createJDKunkRegisterAllocator." I added this file to the header described previously. I implemented it, in my RegAllocJDKunk.cpp file. Jeff Kunkel On Fri, Oct 15, 2010 at 1:43 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:> The following message is a courtesy copy of an article > that has been posted to gmane.comp.compilers.llvm.devel as well. > > Jeff Kunkel <jdkunk3 at gmail.com> writes: > >> - I placed my code in the the existing CodeGen library. > > Ok. > >> - No, it is not in the CMakeLists.txt. The code is separate from the >> rest of the CodeGen code, but it is linked into the code gen library >> automatically through the visual studio linker. > > If your source code is on a separate file, and that file is not listed > on the CMakeLists.txt file, it is not being compiled. > >> Perhaps something >> funny is going on here. I will try placing the code directly in the >> library, and I will include it to the CMakeLists.txt. > > I'm confused. What means "placing the code directly in the library"? > > Please describe where you wrote your code, specifying file names and > directories. >
So, how do I now link in a custom register allocator now? I am missing a call to the new API initializePass in opt and bugpoint because I am lost. Thanks, Jeff Kunkel On Fri, Oct 15, 2010 at 1:51 PM, Jeff Kunkel <jdkunk3 at gmail.com> wrote:> I ran cmake to build the visual studio projects. Then I included my > code under the Visual Studio interface, but I placed my code separate > from the CodeGen code. Visual studio was smart enough to compile and > link in my code into the CodeGen library. Thus, I did not need to add > my code into the same directory as the CodeGen files, and I did not > need to change the CMakeList.txt. > > The offical name is LLVMCodeGen. > > However, the "opt.obj" and "bugpoint.obj" cannot find the reference > function "llvm::createJDKunkRegisterAllocator." I added this file to > the header described previously. I implemented it, in my > RegAllocJDKunk.cpp file. > > Jeff Kunkel > > > On Fri, Oct 15, 2010 at 1:43 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: >> The following message is a courtesy copy of an article >> that has been posted to gmane.comp.compilers.llvm.devel as well. >> >> Jeff Kunkel <jdkunk3 at gmail.com> writes: >> >>> - I placed my code in the the existing CodeGen library. >> >> Ok. >> >>> - No, it is not in the CMakeLists.txt. The code is separate from the >>> rest of the CodeGen code, but it is linked into the code gen library >>> automatically through the visual studio linker. >> >> If your source code is on a separate file, and that file is not listed >> on the CMakeLists.txt file, it is not being compiled. >> >>> Perhaps something >>> funny is going on here. I will try placing the code directly in the >>> library, and I will include it to the CMakeLists.txt. >> >> I'm confused. What means "placing the code directly in the library"? >> >> Please describe where you wrote your code, specifying file names and >> directories. >> >
Jeff Kunkel <jdkunk3 at gmail.com> writes:> I ran cmake to build the visual studio projects. Then I included my > code under the Visual Studio interface, but I placed my code separate > from the CodeGen code. Visual studio was smart enough to compile and > link in my code into the CodeGen library. Thus, I did not need to add > my code into the same directory as the CodeGen files, and I did not > need to change the CMakeList.txt.Next time you update your LLVM sources, that VS solution will be overwritten.> The offical name is LLVMCodeGen. > > However, the "opt.obj" and "bugpoint.obj" cannot find the reference > function "llvm::createJDKunkRegisterAllocator." I added this file to > the header described previously. I implemented it, in my > RegAllocJDKunk.cpp file.As you do not provide the information I asked for, I can't help you anymore.
I'm sorry, I don't know what you were looking for. The first 5 were scattered amidst different e-mails. The others have to do with following what "RAFast" and "RALinScan" as examples. It's a linker error, and I do not know why only opt and bugpoint does not compiler, and why llc does not show my reg alloc pass anymore. It worked before the API change e-mail was released. 1) I created my .cpp file RegAllocJDKunk.cpp in llvm/lib/CodeGen/ directory. 2) I updated the CMakeList.txt in the directory llvm/lib/CodeGen/ to include RegAllocJDKunk.cpp. 3) I added "(void) llvm::createJDKunkRegisterAllocator();" to the struct ForcePassLinking::ForcePassLinking() method in "llvm\include\llvm\LinkAllPasses.h" 4) I added "FunctionPass* createJDKunkRegisterAllocator();" to header "llvm\CodeGen\Passes.h." 5) I implemented "FunctionPass* createJDKunkRegisterAllocator()" in my cpp file. 6) I added "initializeRAJDKunk(Registry);" to llvm/lib/CodeGen/CodeGen.cpp in the "void llvm::initializeCodeGen(PassRegistry &Registry)" 7) I added "void initializeRAJDKunk(PassRegistry&);" to the header file "llvm\include\llvm\InitializePasses.h." 8) Cmake ran, and Visaul Studio build all but opt and bugpoint because of the errors at the bottom of this message. 9) I don't know why this does not link anymore. I remember it worked before the API change e-mail was sent, so I assumed I missed something with the api change. This is the only reason I can see. 2> Creating library C:/Users/JDKunk/Documents/Visual Studio 2010/Projects/VSllvm/lib/Debug/bugpoint.lib and object C:/Users/JDKunk/Documents/Visual Studio 2010/Projects/VSllvm/lib/Debug/bugpoint.exp 2>bugpoint.obj : error LNK2019: unresolved external symbol "class llvm::FunctionPass * __cdecl llvm::createJDKunkRegisterAllocator(void)" (?createJDKunkRegisterAllocator at llvm@@YAPAVFunctionPass at 1@XZ) referenced in function "public: __thiscall `anonymous namespace'::ForcePassLinking::ForcePassLinking(void)" (??0ForcePassLinking@?A0xb2143f5b@@QAE at XZ) 4> Creating library C:/Users/JDKunk/Documents/Visual Studio 2010/Projects/VSllvm/lib/Debug/opt.lib and object C:/Users/JDKunk/Documents/Visual Studio 2010/Projects/VSllvm/lib/Debug/opt.exp 4>opt.obj : error LNK2019: unresolved external symbol "class llvm::FunctionPass * __cdecl llvm::createJDKunkRegisterAllocator(void)" (?createJDKunkRegisterAllocator at llvm@@YAPAVFunctionPass at 1@XZ) referenced in function "public: __thiscall `anonymous namespace'::ForcePassLinking::ForcePassLinking(void)" (??0ForcePassLinking@?A0x853fd888@@QAE at XZ) On Fri, Oct 15, 2010 at 3:10 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:> Jeff Kunkel <jdkunk3 at gmail.com> writes: > >> I ran cmake to build the visual studio projects. Then I included my >> code under the Visual Studio interface, but I placed my code separate >> from the CodeGen code. Visual studio was smart enough to compile and >> link in my code into the CodeGen library. Thus, I did not need to add >> my code into the same directory as the CodeGen files, and I did not >> need to change the CMakeList.txt. > > Next time you update your LLVM sources, that VS solution will be > overwritten. > >> The offical name is LLVMCodeGen. >> >> However, the "opt.obj" and "bugpoint.obj" cannot find the reference >> function "llvm::createJDKunkRegisterAllocator." I added this file to >> the header described previously. I implemented it, in my >> RegAllocJDKunk.cpp file. > > As you do not provide the information I asked for, I can't help you > anymore. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >