[Rose-public] Building a variable declaration

Tim rose.mailinglist at gmail.com
Mon Mar 30 21:14:23 PDT 2015


Hello Dan,
hello rose mailing list,

please find attached my */minimal/* example of creating a new variable 
declaration.
In the example I try to create a variable declaration via this function 
call:

/    SgVariableDeclaration *var_decl = 
SageBuilder::buildVariableDeclaration(//
//        "my_var", SageBuilder::buildIntType(), NULL, 
(*stmt_iter)->get_scope());/

Afterwards, I try to unparse the variable declaration and receive this 
error:

    /Note: found IR node where parent was not set = 0x7fc48caa62a0 =
    SgVariableDeclaration (may not be required) //
    //Inside of Sg_File_Info::display(Location of problematic IR node)
    of this pointer = 0x1291468 //
    //     isTransformation                      = true (part of a
    transformation) //
    //     isCompilerGenerated                   = false //
    //     isOutputInCodeGeneration              = true (output in code
    generator) //
    //     isShared                              = false //
    //     isFrontendSpecific                    = false //
    //     isSourcePositionUnavailableInFrontend = false //
    //     isCommentOrDirective                  = false //
    //     isToken                               = false //
    //     isDefaultArgument                     = false //
    //     isImplicitCast                        = false //
    //filename and line, column info should be invalid for
    transformation or compiler generated objects//
    //we print their values anyway for your reference//
    //     filename = transformation //
    //     line     = 0  column = 0 //
    //     physical_file_id       = -3 = transformation //
    //     physical_line          = 0 //
    //     source_sequence_number = 0 //
    //Error: NULL parent pointer not allowed for statement =
    0x7fc48caa62a0 = SgVariableDeclaration = _variable_declaration_my_var //
    //Inside of Sg_File_Info::display(Error: NULL parent pointer not
    allowed for statement) of this pointer = 0x1291468 //
    //     isTransformation                      = true (part of a
    transformation) //
    //     isCompilerGenerated                   = false //
    //     isOutputInCodeGeneration              = true (output in code
    generator) //
    //     isShared                              = false //
    //     isFrontendSpecific                    = false //
    //     isSourcePositionUnavailableInFrontend = false //
    //     isCommentOrDirective                  = false //
    //     isToken                               = false //
    //     isDefaultArgument                     = false //
    //     isImplicitCast                        = false //
    //filename and line, column info should be invalid for
    transformation or compiler generated objects//
    //we print their values anyway for your reference//
    //     filename = transformation //
    //     line     = 0  column = 0 //
    //     physical_file_id       = -3 = transformation //
    //     physical_line          = 0 //
    //     source_sequence_number = 0 //
    //create_var.out: Cxx_Grammar.C:91401: virtual SgScopeStatement*
    SgStatement::get_scope() const: Assertion `stmt->get_parent() !=
    __null' failed.//
    //Aborted (core dumped)/

Can somebody please help me out? I am stuck.
Iam very thankful for any hint!

Best regards

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nersc.gov/pipermail/rose-public/attachments/20150330/79ba95ac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create_var.cpp
Type: text/x-c++src
Size: 1347 bytes
Desc: not available
URL: <http://mailman.nersc.gov/pipermail/rose-public/attachments/20150330/79ba95ac/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: input_create_var.cpp
Type: text/x-c++src
Size: 57 bytes
Desc: not available
URL: <http://mailman.nersc.gov/pipermail/rose-public/attachments/20150330/79ba95ac/attachment-0001.bin>


More information about the rose-public mailing list