Understanding assert in SelectionDAGBuilder.cpp

I am new to LLVM. I am experimenting with a toy backend. I don’t understand

“LowerFormalArguments didn’t return a valid chain” in SelectionDAGBuilder.cpp file. What is the interface here? What does it mean by returning a Chain?


Have you read http://llvm.org/docs/CodeGenerator.html#instruction-selection-section ? That covers the general DAG representation and the meaning of a “chain”.

In general, if you don’t understand how something in SelectionDAG is supposed to work, I’d suggest looking at other targets, and using the dumping options frequently.


Thanks, I’ll check it out. Is the interface that functions mutate DAG and return Chain nodes and we can traverse DAG using Chain? How do I traverse DAG in BFS order?