Skip to content

Commit

Permalink
Expose getTypeName to the C API. Patch by Patrick Walton.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125845 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Feb 18, 2011
1 parent 39a7de7 commit 1e09e5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/llvm-c/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
LLVMBool LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty);
void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty);

/** See Module::dump. */
void LLVMDumpModule(LLVMModuleRef M);
Expand Down
4 changes: 4 additions & 0 deletions lib/VMCore/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {
return wrap(unwrap(M)->getTypeByName(Name));
}

const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty) {
return unwrap(M)->getTypeName(unwrap(Ty)).c_str();
}

void LLVMDumpModule(LLVMModuleRef M) {
unwrap(M)->dump();
}
Expand Down

0 comments on commit 1e09e5b

Please sign in to comment.