diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-09-11 20:43:05 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-09-11 20:43:05 +0000 |
commit | 74bcd21e342faffb558ff58d635f4c974c4213fc (patch) | |
tree | ff003ed177014ce223a0d7f2ea6900e480f6a522 /clang/tools/libclang | |
parent | 744267765caabf432cbcc126ad2726d96761a865 (diff) | |
download | bcm5719-llvm-74bcd21e342faffb558ff58d635f4c974c4213fc.tar.gz bcm5719-llvm-74bcd21e342faffb558ff58d635f4c974c4213fc.zip |
[tooling] In CompileCommand, Expose the 'file' that was associated with the command.
llvm-svn: 247468
Diffstat (limited to 'clang/tools/libclang')
-rw-r--r-- | clang/tools/libclang/CXCompilationDatabase.cpp | 10 | ||||
-rw-r--r-- | clang/tools/libclang/libclang.exports | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/tools/libclang/CXCompilationDatabase.cpp b/clang/tools/libclang/CXCompilationDatabase.cpp index 1e4a2cd44aa..82498bf54c7 100644 --- a/clang/tools/libclang/CXCompilationDatabase.cpp +++ b/clang/tools/libclang/CXCompilationDatabase.cpp @@ -111,6 +111,16 @@ clang_CompileCommand_getDirectory(CXCompileCommand CCmd) return cxstring::createRef(cmd->Directory.c_str()); } +CXString +clang_CompileCommand_getFilename(CXCompileCommand CCmd) +{ + if (!CCmd) + return cxstring::createNull(); + + CompileCommand *cmd = static_cast<CompileCommand *>(CCmd); + return cxstring::createRef(cmd->Filename.c_str()); +} + unsigned clang_CompileCommand_getNumArgs(CXCompileCommand CCmd) { diff --git a/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports index 44f3836a114..5179b96fc61 100644 --- a/clang/tools/libclang/libclang.exports +++ b/clang/tools/libclang/libclang.exports @@ -297,6 +297,7 @@ clang_CompileCommands_dispose clang_CompileCommands_getSize clang_CompileCommands_getCommand clang_CompileCommand_getDirectory +clang_CompileCommand_getFilename clang_CompileCommand_getMappedSourceContent clang_CompileCommand_getMappedSourcePath clang_CompileCommand_getNumArgs |