-Linker::Linker(const std::string& progname, const std::string& modname, unsigned flags)
- : Composite(0)
- , LibPaths()
- , Flags(flags)
- , Error()
- , ProgramName(progname)
-{
- Composite = new Module(modname);
-}
-
-Linker::Linker(const std::string& progname, Module* aModule, unsigned flags)
- : Composite(aModule)
- , LibPaths()
- , Flags(flags)
- , Error()
- , ProgramName(progname)
-{
-}
+Linker::Linker(StringRef progname, StringRef modname,
+ LLVMContext& C, unsigned flags):
+ Context(C),
+ Composite(new Module(modname, C)),
+ LibPaths(),
+ Flags(flags),
+ Error(),
+ ProgramName(progname) { }
+
+Linker::Linker(StringRef progname, Module* aModule, unsigned flags) :
+ Context(aModule->getContext()),
+ Composite(aModule),
+ LibPaths(),
+ Flags(flags),
+ Error(),
+ ProgramName(progname) { }