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 | 709eaacb36e36affddf020b60459778be8299c65 (patch) | |
| tree | 0d241fb8e24b8aad1e91027e54142284e8afe630 /llvm/lib/CodeGen | |
| parent | ef023cb6e9182811b14ee1940e6d35bae50eb447 (diff) | |
| download | bcm5719-llvm-709eaacb36e36affddf020b60459778be8299c65.tar.gz bcm5719-llvm-709eaacb36e36affddf020b60459778be8299c65.zip | |
Expand some code with temporary variables to rid ourselves of the warning
about "dereferencing type-punned pointer will break strict-aliasing rules"
llvm-svn: 27671
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineDebugInfo.cpp | 28 | 
1 files changed, 21 insertions, 7 deletions
| diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp index 2e7e8c0d9f1..2e3c034898d 100644 --- a/llvm/lib/CodeGen/MachineDebugInfo.cpp +++ b/llvm/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);  } | 

