Add clang_getDeclSource().

llvm-svn: 82807
This commit is contained in:
Steve Naroff 2009-09-25 21:45:39 +00:00
parent d90fd526d3
commit 2676089407
3 changed files with 10 additions and 0 deletions

View File

@ -177,6 +177,7 @@ CXEntity clang_getEntityFromDecl(CXDecl);
const char *clang_getDeclSpelling(CXDecl);
unsigned clang_getDeclLine(CXDecl);
unsigned clang_getDeclColumn(CXDecl);
const char *clang_getDeclSource(CXDecl);
/*
* CXCursor Operations.

View File

@ -370,6 +370,14 @@ unsigned clang_getDeclColumn(CXDecl AnonDecl)
return SourceMgr.getSpellingLineNumber(ND->getLocation());
}
const char *clang_getDeclSource(CXDecl AnonDecl)
{
assert(AnonDecl && "Passed null CXDecl");
NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl);
SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
return SourceMgr.getBufferName(ND->getLocation());
}
const char *clang_getCursorSpelling(CXCursor C)
{
assert(C.decl && "CXCursor has null decl");

View File

@ -11,6 +11,7 @@ _clang_getDeclarationName
_clang_getDeclSpelling
_clang_getDeclLine
_clang_getDeclColumn
_clang_getDeclSource
_clang_getEntity
_clang_getEntityFromDecl
_clang_getURI