[LLVMbugs] [Bug 4625] New: cpp backend does not support new API (LLVMContext, etc)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jul 26 07:39:20 PDT 2009


           Summary: cpp backend does not support new API (LLVMContext, etc)
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: extremal.ik at gmail.com
                CC: llvmbugs at cs.uiuc.edu

; ModuleID = 'test.bc'

define void @test(i32 %value) nounwind  {
    %tmp0 = icmp eq i32 %value, 0
    ret void

after llvm-as and llc -march=cpp calling we have this C++ code:

// Generated by llvm2cpp - DO NOT MODIFY!

Module* makeXorEncryptModule(Module *mod) {


// Type Definitions
std::vector<const Type*>FuncTy_0_args;
FunctionType* FuncTy_0 = FunctionType::get(

// Function Declarations

Function* func_test = Function::Create(
  /*Name=*/"test", mod); 
AttrListPtr func_test_PAL;
  SmallVector<AttributeWithIndex, 4> Attrs;
  AttributeWithIndex PAWI;
  PAWI.Index = 4294967295U; PAWI.Attrs = 0  | Attribute::NoUnwind;
  func_test_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());


// Global Variable Declarations

// Constant Definitions
ConstantInt* const_int32_1 = ConstantInt::get(APInt(32,  "0", 1, 10));

// Global Variable Definitions

// Function Definitions

// Function: test (func_test)
  Function::arg_iterator args = func_test->arg_begin();
  Value* int32_value = args++;

  BasicBlock* label_entry = BasicBlock::Create("entry",func_test,0);

  // Block entry (label_entry)
  ICmpInst* int1_tmp0 = new ICmpInst(ICmpInst::ICMP_EQ, int32_value,
const_int32_1, "tmp0", label_entry);


return mod;


This code valid for llvm 2.5, but not for top-of-tree(for example
ConstantInt::get call at line 39 is obsolete).

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list