aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/ExpandUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/NaCl/ExpandUtils.cpp')
-rw-r--r--lib/Transforms/NaCl/ExpandUtils.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/Transforms/NaCl/ExpandUtils.cpp b/lib/Transforms/NaCl/ExpandUtils.cpp
index 75f5dad114..6914b6dd84 100644
--- a/lib/Transforms/NaCl/ExpandUtils.cpp
+++ b/lib/Transforms/NaCl/ExpandUtils.cpp
@@ -59,27 +59,3 @@ Function *llvm::RecreateFunction(Function *Func, FunctionType *NewType) {
Func->getFunctionType()->getPointerTo()));
return NewFunc;
}
-
-void llvm::ReplaceUsesOfStructWithFields(
- Value *StructVal, const SmallVectorImpl<Value *> &Fields) {
- while (!StructVal->use_empty()) {
- User *U = StructVal->use_back();
- ExtractValueInst *Field = dyn_cast<ExtractValueInst>(U);
- if (!Field) {
- errs() << "Use: " << *U << "\n";
- report_fatal_error("ReplaceUsesOfStructWithFields: "
- "Struct use site is not an extractvalue");
- }
- if (Field->getNumIndices() != 1) {
- // If we wanted to handle this case, we could split the
- // extractvalue into two extractvalues and run ExpandLoad()
- // multiple times.
- errs() << "Use: " << *U << "\n";
- report_fatal_error("ReplaceUsesOfStructWithFields: Unexpected indices");
- }
- unsigned Index = Field->getIndices()[0];
- assert(Index < Fields.size());
- Field->replaceAllUsesWith(Fields[Index]);
- Field->eraseFromParent();
- }
-}