Preserve the new moduleID field
llvm-svn: 5835
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index 223e3fd..116ae0d 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -18,7 +18,7 @@
///
Module *CloneModule(const Module *M) {
// First off, we need to create the new module...
- Module *New = new Module();
+ Module *New = new Module(M->getModuleIdentifier());
// Create the value map that maps things from the old module over to the new
// module.