[llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Reid Spencer
reid at x10sys.com
Thu Apr 13 11:30:10 PDT 2006
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.37 -> 1.38
---
Log message:
Expand some code with temporary variables to rid ourselves of the warning
about "dereferencing type-punned pointer will break strict-aliasing rules"
---
Diffs of the changes: (+21 -7)
MachineDebugInfo.cpp | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.37 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.38
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.37 Fri Apr 7 11:34:45 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Thu Apr 13 13:29:58 2006
@@ -580,7 +580,9 @@
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 @@
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 @@
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 @@
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 @@
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);
}
More information about the llvm-commits
mailing list