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

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

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 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
OLDNEW
1 //===- RewriteLLVMIntrinsics.cpp - Rewrite LLVM intrinsics to other values ===// 1 //===- RewriteLLVMIntrinsics.cpp - Rewrite LLVM intrinsics to other values ===//
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 // This pass replaces calls to LLVM intrinsics that are *not* part of the 10 // This pass replaces calls to LLVM intrinsics that are *not* part of the
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 IntrinsicRewriter(Module &M, Intrinsic::ID IntrinsicID) 47 IntrinsicRewriter(Module &M, Intrinsic::ID IntrinsicID)
48 : F(Intrinsic::getDeclaration(&M, IntrinsicID)) {} 48 : F(Intrinsic::getDeclaration(&M, IntrinsicID)) {}
49 virtual ~IntrinsicRewriter() {} 49 virtual ~IntrinsicRewriter() {}
50 /// This pure virtual method must be defined by implementors, and 50 /// This pure virtual method must be defined by implementors, and
51 /// will be called by rewriteCall. 51 /// will be called by rewriteCall.
52 virtual void doRewriteCall(CallInst *Call) = 0; 52 virtual void doRewriteCall(CallInst *Call) = 0;
53 53
54 Function *F; 54 Function *F;
55 55
56 private: 56 private:
57 IntrinsicRewriter() LLVM_DELETED_FUNCTION; 57 IntrinsicRewriter() = delete;
58 IntrinsicRewriter(const IntrinsicRewriter &) LLVM_DELETED_FUNCTION; 58 IntrinsicRewriter(const IntrinsicRewriter &) = delete;
59 IntrinsicRewriter &operator=( 59 IntrinsicRewriter &operator=(const IntrinsicRewriter &) = delete;
60 const IntrinsicRewriter &) LLVM_DELETED_FUNCTION;
61 }; 60 };
62 61
63 private: 62 private:
64 /// Visit all uses of a Function, rewrite it using the \p Rewriter, 63 /// Visit all uses of a Function, rewrite it using the \p Rewriter,
65 /// and then delete the Call. Later delete the Function from the 64 /// and then delete the Call. Later delete the Function from the
66 /// Module. Returns true if the Module was changed. 65 /// Module. Returns true if the Module was changed.
67 bool visitUses(IntrinsicRewriter &Rewriter); 66 bool visitUses(IntrinsicRewriter &Rewriter);
68 }; 67 };
69 68
70 /// Rewrite a Call to nothing. 69 /// Rewrite a Call to nothing.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 Call->eraseFromParent(); 140 Call->eraseFromParent();
142 } 141 }
143 142
144 F->eraseFromParent(); 143 F->eraseFromParent();
145 return !Calls.empty(); 144 return !Calls.empty();
146 } 145 }
147 146
148 ModulePass *llvm::createRewriteLLVMIntrinsicsPass() { 147 ModulePass *llvm::createRewriteLLVMIntrinsicsPass() {
149 return new RewriteLLVMIntrinsics(); 148 return new RewriteLLVMIntrinsics();
150 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698