Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: lib/Transforms/NaCl/ExpandUtils.cpp

Issue 14262011: PNaCl: Add ReplacePtrsWithInts pass for stripping out pointer types (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Review nits Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Transforms/NaCl/CMakeLists.txt ('k') | lib/Transforms/NaCl/ExpandVarArgs.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- ExpandUtils.cpp - Helper functions for expansion passes -----------===// 1 //===-- ExpandUtils.cpp - Helper functions for expansion passes -----------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #include "llvm/IR/BasicBlock.h" 10 #include "llvm/IR/BasicBlock.h"
(...skipping 20 matching lines...) Expand all
31 // incoming value. 31 // incoming value.
32 BasicBlock *BB = PN->getIncomingBlock(*U); 32 BasicBlock *BB = PN->getIncomingBlock(*U);
33 for (unsigned I = 0; I < PN->getNumIncomingValues(); ++I) { 33 for (unsigned I = 0; I < PN->getNumIncomingValues(); ++I) {
34 if (PN->getIncomingBlock(I) == BB) 34 if (PN->getIncomingBlock(I) == BB)
35 PN->setIncomingValue(I, NewVal); 35 PN->setIncomingValue(I, NewVal);
36 } 36 }
37 } else { 37 } else {
38 U->getUser()->replaceUsesOfWith(U->get(), NewVal); 38 U->getUser()->replaceUsesOfWith(U->get(), NewVal);
39 } 39 }
40 } 40 }
41
42 Instruction *llvm::CopyDebug(Instruction *NewInst, Instruction *Original) {
43 NewInst->setDebugLoc(Original->getDebugLoc());
44 return NewInst;
45 }
OLDNEW
« no previous file with comments | « lib/Transforms/NaCl/CMakeLists.txt ('k') | lib/Transforms/NaCl/ExpandVarArgs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698