diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-04-13 18:29:58 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-04-13 18:29:58 +0000 |
commit | 60d07eeffe80e8b7a3e1fad9420614b8438ba7e3 (patch) | |
tree | dcf3bd0a26abe5f9a550452f3cac9c49eb27af8a /lib | |
parent | 463b4e5f4c52ebf5685782da8ba507349051aa16 (diff) | |
download | external_llvm-60d07eeffe80e8b7a3e1fad9420614b8438ba7e3.zip external_llvm-60d07eeffe80e8b7a3e1fad9420614b8438ba7e3.tar.gz external_llvm-60d07eeffe80e8b7a3e1fad9420614b8438ba7e3.tar.bz2 |
Expand some code with temporary variables to rid ourselves of the warning
about "dereferencing type-punned pointer will break strict-aliasing rules"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 2e7e8c0..2e3c034 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/lib/CodeGen/MachineDebugInfo.cpp @@ -580,7 +580,9 @@ AnchoredDesc::AnchoredDesc(unsigned T) void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) { DebugInfoDesc::ApplyToFields(Visitor); - Visitor->Apply((DebugInfoDesc *&)Anchor); + DebugInfoDesc *Tmp = Anchor; + Visitor->Apply(Tmp); + Anchor = (AnchorDesc*)Tmp; } //===----------------------------------------------------------------------===// @@ -670,7 +672,9 @@ void TypeDesc::ApplyToFields(DIVisitor *Visitor) { Visitor->Apply(Context); Visitor->Apply(Name); - Visitor->Apply((DebugInfoDesc *&)File); + DebugInfoDesc* Tmp = File; + Visitor->Apply(Tmp); + File = (CompileUnitDesc*)Tmp; Visitor->Apply(Line); Visitor->Apply(Size); Visitor->Apply(Align); @@ -775,7 +779,9 @@ bool DerivedTypeDesc::classof(const DebugInfoDesc *D) { void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) { TypeDesc::ApplyToFields(Visitor); - Visitor->Apply((DebugInfoDesc *&)FromType); + DebugInfoDesc* Tmp = FromType; + Visitor->Apply(Tmp); + FromType = (TypeDesc*)Tmp; } /// getDescString - Return a string used to compose global names and labels. @@ -975,9 +981,13 @@ void VariableDesc::ApplyToFields(DIVisitor *Visitor) { Visitor->Apply(Context); Visitor->Apply(Name); - Visitor->Apply((DebugInfoDesc *&)File); + DebugInfoDesc* Tmp1 = File; + Visitor->Apply(Tmp1); + File = (CompileUnitDesc*)Tmp1; Visitor->Apply(Line); - Visitor->Apply((DebugInfoDesc *&)TyDesc); + DebugInfoDesc* Tmp2 = TyDesc; + Visitor->Apply(Tmp2); + TyDesc = (TypeDesc*)Tmp2; } /// getDescString - Return a string used to compose global names and labels. @@ -1024,9 +1034,13 @@ void GlobalDesc::ApplyToFields(DIVisitor *Visitor) { Visitor->Apply(Context); Visitor->Apply(Name); - Visitor->Apply((DebugInfoDesc *&)File); + DebugInfoDesc* Tmp1 = File; + Visitor->Apply(Tmp1); + File = (CompileUnitDesc*)Tmp1; Visitor->Apply(Line); - Visitor->Apply((DebugInfoDesc *&)TyDesc); + DebugInfoDesc* Tmp2 = TyDesc; + Visitor->Apply(Tmp2); + TyDesc = (TypeDesc*)Tmp2; Visitor->Apply(IsStatic); Visitor->Apply(IsDefinition); } |