Index: llvm/trunk/include/llvm-c/Core.h =================================================================== --- llvm/trunk/include/llvm-c/Core.h +++ llvm/trunk/include/llvm-c/Core.h @@ -2807,6 +2807,15 @@ LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); /** + * Create a new basic block without inserting it into a function. + * + * @see llvm::BasicBlock::Create() + */ +LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, + const char *Name, + size_t NameLen); + +/** * Append a basic block to the end of a function. * * @see llvm::BasicBlock::Create() Index: llvm/trunk/lib/IR/Core.cpp =================================================================== --- llvm/trunk/lib/IR/Core.cpp +++ llvm/trunk/lib/IR/Core.cpp @@ -2532,6 +2532,12 @@ return wrap(&*--I); } +LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, + const char *Name, + size_t NameLen) { + return wrap(llvm::BasicBlock::Create(*unwrap(C), StringRef(Name, NameLen))); +} + LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef FnRef, const char *Name) {