mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	Revert 106528. It is causing self host failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106529 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -21,15 +21,17 @@
 | 
				
			|||||||
using namespace llvm;
 | 
					using namespace llvm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) {
 | 
					Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) {
 | 
				
			||||||
  ValueToValueMapTy::iterator VMI = VM.find(V);
 | 
					  Value *&VMSlot = VM[V];
 | 
				
			||||||
  if (VMI != VM.end())
 | 
					  if (VMSlot) return VMSlot;      // Does it exist in the map yet?
 | 
				
			||||||
    return VMI->second;
 | 
					  
 | 
				
			||||||
 | 
					  // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the
 | 
				
			||||||
 | 
					  // DenseMap.  This includes any recursive calls to MapValue.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Global values and non-function-local metadata do not need to be seeded into
 | 
					  // Global values and non-function-local metadata do not need to be seeded into
 | 
				
			||||||
  // the ValueMap if they are using the identity mapping.
 | 
					  // the ValueMap if they are using the identity mapping.
 | 
				
			||||||
  if (isa<GlobalValue>(V) || isa<InlineAsm>(V) || isa<MDString>(V) ||
 | 
					  if (isa<GlobalValue>(V) || isa<InlineAsm>(V) || isa<MDString>(V) ||
 | 
				
			||||||
      (isa<MDNode>(V) && !cast<MDNode>(V)->isFunctionLocal()))
 | 
					      (isa<MDNode>(V) && !cast<MDNode>(V)->isFunctionLocal()))
 | 
				
			||||||
    return VM[V] = const_cast<Value*>(V);
 | 
					    return VMSlot = const_cast<Value*>(V);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (const MDNode *MD = dyn_cast<MDNode>(V)) {
 | 
					  if (const MDNode *MD = dyn_cast<MDNode>(V)) {
 | 
				
			||||||
    SmallVector<Value*, 4> Elts;
 | 
					    SmallVector<Value*, 4> Elts;
 | 
				
			||||||
@@ -44,7 +46,7 @@ Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) {
 | 
				
			|||||||
  if (isa<ConstantInt>(C) || isa<ConstantFP>(C) ||
 | 
					  if (isa<ConstantInt>(C) || isa<ConstantFP>(C) ||
 | 
				
			||||||
      isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C) ||
 | 
					      isa<ConstantPointerNull>(C) || isa<ConstantAggregateZero>(C) ||
 | 
				
			||||||
      isa<UndefValue>(C) || isa<MDString>(C))
 | 
					      isa<UndefValue>(C) || isa<MDString>(C))
 | 
				
			||||||
    return VM[V] = C;           // Primitive constants map directly
 | 
					    return VMSlot = C;           // Primitive constants map directly
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
 | 
					  if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
 | 
				
			||||||
    for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end();
 | 
					    for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user