LLVM. ¿Cómo acceder a los campos de estructura basados ​​en sus nombres?

Tengo un pequeño código de ejemplo en C ++:

struct RecordTest
{
    int value1;
    int value2;
};

void test()
{
    RecordTest rt;
    rt.value1 = 15;
    rt.value2 = 75;
}

y LLVM 3.4 IR para ello:

%struct.RecordTest = type { i32, i32 }

; Function Attrs: nounwind
define void @_Z4testv() #0 {
entry:
  %rt = alloca %struct.RecordTest, align 4
  %value1 = getelementptr inbounds %struct.RecordTest* %rt, i32 0, i32 0
  store i32 15, i32* %value1, align 4
  %value2 = getelementptr inbounds %struct.RecordTest* %rt, i32 0, i32 1
  store i32 75, i32* %value2, align 4
  ret void
}

y una pregunta bastante fácil: ¿Cómo puedo acceder aRecordTest campos (cuando analizo .cpp), sin sus índices, con solo nombres (value1 yvalue2)?

Sólo conozco una manera (desdellc -march=cpp) - Con índices:

  AllocaInst* ptr_rt = new AllocaInst(StructTy_struct_RecordTest, "rt", label_entry);
  ptr_rt->setAlignment(4);
  std::vector<Value*> ptr_value1_indices;
  ptr_value1_indices.push_back(const_int32_6);
  ptr_value1_indices.push_back(const_int32_6);
  Instruction* ptr_value1 = GetElementPtrInst::Create(ptr_rt, ptr_value1_indices, "value1", label_entry);
  StoreInst* void_9 = new StoreInst(const_int32_7, ptr_value1, false, label_entry);
  void_9->setAlignment(4);
  std::vector<Value*> ptr_value2_indices;
  ptr_value2_indices.push_back(const_int32_6);
  ptr_value2_indices.push_back(const_int32_5);
  Instruction* ptr_value2 = GetElementPtrInst::Create(ptr_rt, ptr_value2_indices, "value2", label_entry);
  StoreInst* void_10 = new StoreInst(const_int32_8, ptr_value2, false, label_entry);
  void_10->setAlignment(4);

Entonces, ¿puedo traducir de C ++ a LLVM IR, si no conozco los índices de los campos (const_int32_5&nbsp;yconst_int32_6&nbsp;en el código de arriba)?

UPD ================================

Por lo tanto, no podemos acceder a los nombres de campo. Y si lo necesitamos (y lo hacemos, si analizamos .cpp), podemos escribir algo como esto:

 // It can be some kind of singletone
static std::map<std::string, std::vector<std::string>> mymap;

// Some function, where we first time meet RecordTest
    std::vector<std::string> fieldNames;
    fieldNames.push_back("value1");
    fieldNames.push_back("value2");
    mymap["RecordTest"] = fieldNames;

// Some function, where we need to access to RecordTest field
    std::vector<std::string> fieldNamesAgain = mymap.find("RecordTest")->second;
    std::string fieldName = "value1";
    int idxValue1 = -1;
    for (int i = 0, e = fieldNamesAgain.size(); i < e; i++) // little ugly search
    {
        if (fieldName == fieldNamesAgain[i])
        {
                // we get field index, and now we can build code
                // as in example above (llc -march=cpp)
            idxValue1 = i;  
            break;
        }
    }

Es esto correcto ?