[llvm-commits] [llvm-gcc-4.2] r40056 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Thu Jul 19 06:19:55 PDT 2007


Author: baldrick
Date: Thu Jul 19 08:19:55 2007
New Revision: 40056

URL: http://llvm.org/viewvc/llvm-project?rev=40056&view=rev
Log:
Make this neater.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=40056&r1=40055&r2=40056&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Jul 19 08:19:55 2007
@@ -5170,7 +5170,7 @@
   tree field_offset = component_ref_field_offset (exp);
   // If this is a normal field at a fixed offset from the start, handle it.
   if (TREE_CODE(field_offset) == INTEGER_CST) {
-    unsigned int MemberIndex = TheTypeConverter->GetFieldIndex(FieldDecl);
+    unsigned int MemberIndex = GetFieldIndex(FieldDecl);
     assert(MemberIndex < StructTy->getNumContainedTypes() &&
            "Field Idx out of range!");
     FieldPtr = Builder.CreateGEP(StructAddrLV.Ptr,
@@ -5871,7 +5871,7 @@
   // that contains bits from the bitfield overlayed with the declared type of
   // the bitfield.  This bitfield value may be spread across multiple fields, or
   // it may be just this field, or it may just be a small part of this field.
-  unsigned int FieldNo = TheTypeConverter->GetFieldIndex(Field);
+  unsigned int FieldNo = GetFieldIndex(Field);
   assert(FieldNo < ResultElts.size() && "Invalid struct field number!");
 
   // Get the offset and size of the LLVM field.
@@ -6009,7 +6009,7 @@
       ProcessBitFieldInitialization(Field, Val, STy, ResultElts);
     } else {
       // If not, things are much simpler.
-      unsigned int FieldNo = TheTypeConverter->GetFieldIndex(Field);
+      unsigned int FieldNo = GetFieldIndex(Field);
       assert(FieldNo < ResultElts.size() && "Invalid struct field number!");
 
       // Example: struct X { int A; char C[]; } x = { 4, "foo" };
@@ -6242,7 +6242,7 @@
   tree field_offset = component_ref_field_offset (exp);
   // If this is a normal field at a fixed offset from the start, handle it.
   if (TREE_CODE(field_offset) == INTEGER_CST) {
-    unsigned int MemberIndex = TheTypeConverter->GetFieldIndex(FieldDecl);
+    unsigned int MemberIndex = GetFieldIndex(FieldDecl);
 
     std::vector<Value*> Idxs;
     Idxs.push_back(Constant::getNullValue(Type::Int32Ty));





More information about the llvm-commits mailing list