| 801 | } |
| 802 | |
| 803 | const char* ClangHelper::DetermineFilesReferenced(const StringImpl& fileName) |
| 804 | { |
| 805 | BfLogClang("%d Clang DetermineFilesReferenced %s\n", ::GetCurrentThreadId(), fileName.c_str()); |
| 806 | |
| 807 | gClangPerfManager.ZoneStart("Clang DetermineFilesReferenced"); |
| 808 | |
| 809 | ClangTranslationUnit* clangTransUnit = GetTranslationUnit(fileName, NULL, 0); |
| 810 | CXTranslationUnit transUnit = clangTransUnit->mTransUnit; |
| 811 | if (transUnit == NULL) |
| 812 | return NULL; |
| 813 | |
| 814 | CXFile file = clang_getFile(transUnit, fileName.c_str()); |
| 815 | |
| 816 | mReturnString.clear(); |
| 817 | ClangFindFiles clangFindFiles; |
| 818 | |
| 819 | gClangPerfManager.ZoneStart("clang_getInclusions"); |
| 820 | clang_getInclusions(transUnit, ClangFindFiles::InclusionProc, &clangFindFiles); |
| 821 | gClangPerfManager.ZoneEnd(); |
| 822 | |
| 823 | for (auto& fileName : clangFindFiles.mFileSet) |
| 824 | { |
| 825 | String fixedFileName = fileName; |
| 826 | for (int i = 0; i < (int)fixedFileName.length(); i++) |
| 827 | { |
| 828 | if (fixedFileName[i] == DIR_SEP_CHAR_ALT) |
| 829 | fixedFileName[i] = DIR_SEP_CHAR; |
| 830 | } |
| 831 | mReturnString += fixedFileName + "\n"; |
| 832 | } |
| 833 | |
| 834 | gClangPerfManager.ZoneEnd(); |
| 835 | |
| 836 | if (gClangPerfManager.mRecording) |
| 837 | { |
| 838 | gClangPerfManager.StopRecording(); |
| 839 | gClangPerfManager.DbgPrint(); |
| 840 | } |
| 841 | |
| 842 | return mReturnString.c_str(); |
| 843 | } |
| 844 | |
| 845 | void ClangHelper::CheckErrorRange(const StringImpl& errorString, int startIdx, int endIdx, int errorLookupTextIdx) |
| 846 | { |
no test coverage detected