aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp2
-rw-r--r--lib/Target/ELFTargetAsmInfo.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 81a3342071..0ae304e2d4 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -128,7 +128,7 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
const Section*
DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
- Constant *C = cast<GlobalVariable>(GV)->getInitializer();
+ Constant *C = GV->getInitializer();
return MergeableConstSection(C->getType());
}
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp
index b9e9812575..7c9e4546d2 100644
--- a/lib/Target/ELFTargetAsmInfo.cpp
+++ b/lib/Target/ELFTargetAsmInfo.cpp
@@ -96,7 +96,7 @@ ELFTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
const Section*
ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
- Constant *C = cast<GlobalVariable>(GV)->getInitializer();
+ Constant *C = GV->getInitializer();
return MergeableConstSection(C->getType());
}