Commits

Ted Kremenek committed b3340392adb
Add CFG instructions CallInst, DeclRefInst, ThisApplyInst, and TypeOfInst, and wire them up in the CFG. This exposes a bunch of issues. First, BasicBlocks and Instructions are BumpPtrAllocated, but this is incompatible with the destructor for ilists. For now we just leak to avoid an incorrect use of free(), but this will need to be fixed. Second, the CFG currently assumes that all values consumed by Instructions are other Instructions. This is not the ultimate design. We want arguments to be temporaries, and temporaries will be arguments to BasicBlocks or Instructions. Getting this working is a next step, but I wanted some skeleton of progress up front to have something to work with. For reference, swift -cfg-dump for: func foo() -> Int { return bar(42) } emits: 1.1: (DeclRef decl=bar) 1.2: (DeclRef decl=convertFromIntegerLiteral) 1.3: (TypeOf type=metatype<Int64>) 1.4: (ThisApply fn=1.2 arg=1.3) 1.5: (Integer val=42 width=64) 1.6: (Call fn=1.4 args={ 1.5}) 1.7: (Call fn=1.1 args={ 1.6}) Major WIP. Swift SVN r2589