Deleted Added
full compact
CloneModule.cpp (193323) CloneModule.cpp (195340)
1//===- CloneModule.cpp - Clone an entire module ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 21 unchanged lines hidden (view full) ---

30 // module.
31 DenseMap<const Value*, Value*> ValueMap;
32 return CloneModule(M, ValueMap);
33}
34
35Module *llvm::CloneModule(const Module *M,
36 DenseMap<const Value*, Value*> &ValueMap) {
37 // First off, we need to create the new module...
1//===- CloneModule.cpp - Clone an entire module ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 21 unchanged lines hidden (view full) ---

30 // module.
31 DenseMap<const Value*, Value*> ValueMap;
32 return CloneModule(M, ValueMap);
33}
34
35Module *llvm::CloneModule(const Module *M,
36 DenseMap<const Value*, Value*> &ValueMap) {
37 // First off, we need to create the new module...
38 Module *New = new Module(M->getModuleIdentifier());
38 Module *New = new Module(M->getModuleIdentifier(), M->getContext());
39 New->setDataLayout(M->getDataLayout());
40 New->setTargetTriple(M->getTargetTriple());
41 New->setModuleInlineAsm(M->getModuleInlineAsm());
42
43 // Copy all of the type symbol table entries over.
44 const TypeSymbolTable &TST = M->getTypeSymbolTable();
45 for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
46 TI != TE; ++TI)

--- 80 unchanged lines hidden ---
39 New->setDataLayout(M->getDataLayout());
40 New->setTargetTriple(M->getTargetTriple());
41 New->setModuleInlineAsm(M->getModuleInlineAsm());
42
43 // Copy all of the type symbol table entries over.
44 const TypeSymbolTable &TST = M->getTypeSymbolTable();
45 for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end();
46 TI != TE; ++TI)

--- 80 unchanged lines hidden ---