MCPcopy Create free account
hub / github.com/beefytech/Beef / DetermineFilesReferenced

Method DetermineFilesReferenced

IDEHelper/Clang/ClangHelper.cpp:803–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803const 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
845void ClangHelper::CheckErrorRange(const StringImpl& errorString, int startIdx, int endIdx, int errorLookupTextIdx)
846{

Calls 7

ZoneStartMethod · 0.80
ZoneEndMethod · 0.80
StopRecordingMethod · 0.80
DbgPrintMethod · 0.80
c_strMethod · 0.45
clearMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected