Deleted Added
full compact
InstructionNamer.cpp (198396) InstructionNamer.cpp (202375)
1//===- InstructionNamer.cpp - Give anonymous instructions names -----------===//
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//===----------------------------------------------------------------------===//

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

27
28 void getAnalysisUsage(AnalysisUsage &Info) const {
29 Info.setPreservesAll();
30 }
31
32 bool runOnFunction(Function &F) {
33 for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end();
34 AI != AE; ++AI)
1//===- InstructionNamer.cpp - Give anonymous instructions names -----------===//
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//===----------------------------------------------------------------------===//

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

27
28 void getAnalysisUsage(AnalysisUsage &Info) const {
29 Info.setPreservesAll();
30 }
31
32 bool runOnFunction(Function &F) {
33 for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end();
34 AI != AE; ++AI)
35 if (!AI->hasName() && AI->getType() != Type::getVoidTy(F.getContext()))
35 if (!AI->hasName() && !AI->getType()->isVoidTy())
36 AI->setName("arg");
37
38 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
39 if (!BB->hasName())
40 BB->setName("bb");
41
42 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
36 AI->setName("arg");
37
38 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
39 if (!BB->hasName())
40 BB->setName("bb");
41
42 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
43 if (!I->hasName() && I->getType() != Type::getVoidTy(F.getContext()))
43 if (!I->hasName() && !I->getType()->isVoidTy())
44 I->setName("tmp");
45 }
46 return true;
47 }
48 };
49
50 char InstNamer::ID = 0;
51 static RegisterPass<InstNamer> X("instnamer",

--- 12 unchanged lines hidden ---
44 I->setName("tmp");
45 }
46 return true;
47 }
48 };
49
50 char InstNamer::ID = 0;
51 static RegisterPass<InstNamer> X("instnamer",

--- 12 unchanged lines hidden ---