| 345 | } |
| 346 | |
| 347 | Function *ProgramEditor::DeclareFunction(const rdcstr &name, const Type *retType, |
| 348 | rdcarray<const Type *> params, Attribute desiredAttrs) |
| 349 | { |
| 350 | Function *ret = GetFunctionByName(name); |
| 351 | |
| 352 | if(!ret) |
| 353 | { |
| 354 | const Type *funcType = CreateFunctionType(retType, params); |
| 355 | |
| 356 | Function functionDef; |
| 357 | functionDef.name = name; |
| 358 | functionDef.type = funcType; |
| 359 | functionDef.external = true; |
| 360 | functionDef.attrs = GetAttributeSet(desiredAttrs); |
| 361 | |
| 362 | ret = DeclareFunction(functionDef); |
| 363 | } |
| 364 | |
| 365 | return ret; |
| 366 | } |
| 367 | |
| 368 | Block *ProgramEditor::CreateBlock() |
| 369 | { |
no test coverage detected