summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-03-06 07:03:54 +0000
committerDevang Patel <dpatel@apple.com>2009-03-06 07:03:54 +0000
commit00e389c8c8874be352358f2cbd23f98d3df5ebad (patch)
tree4ba2aab6355e95ac4f2dd8e8c96c3c029f370f2d /lib/Transforms/Scalar/ScalarReplAggregates.cpp
parentd6f16587ab292b20857933b3ba13d3d1c62a8d62 (diff)
downloadexternal_llvm-00e389c8c8874be352358f2cbd23f98d3df5ebad.zip
external_llvm-00e389c8c8874be352358f2cbd23f98d3df5ebad.tar.gz
external_llvm-00e389c8c8874be352358f2cbd23f98d3df5ebad.tar.bz2
While converting an aggregate to scalare, ignore and remove aggregate's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 710bdfb..f45d4a4 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -1362,7 +1362,11 @@ bool SROA::CanConvertToScalar(Value *V, bool &IsNotTrivial, const Type *&VecTy,
IsNotTrivial = true;
continue;
}
-
+
+ // Ignore dbg intrinsic.
+ if (isa<DbgInfoIntrinsic>(User))
+ continue;
+
// Otherwise, we cannot handle this!
return false;
}
@@ -1442,8 +1446,13 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, uint64_t Offset) {
MSI->eraseFromParent();
continue;
}
-
-
+
+ // If user is a dbg info intrinsic then it is safe to remove it.
+ if (isa<DbgInfoIntrinsic>(User)) {
+ User->eraseFromParent();
+ continue;
+ }
+
assert(0 && "Unsupported operation!");
abort();
}