diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangAttrEmitter.cpp | 4 | ||||
-rwxr-xr-x | utils/analyzer/CmpRuns.py | 6 | ||||
-rw-r--r-- | utils/analyzer/SATestBuild.py | 15 |
3 files changed, 19 insertions, 6 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index f79c4a5..5dc33a0 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -1066,7 +1066,7 @@ createArgument(const Record &Arg, StringRef Attr, if (!Ptr) { // Search in reverse order so that the most-derived type is handled first. - std::vector<Record*> Bases = Search->getSuperClasses(); + ArrayRef<Record*> Bases = Search->getSuperClasses(); for (const auto *Base : llvm::make_range(Bases.rbegin(), Bases.rend())) { if ((Ptr = createArgument(Arg, Attr, Base))) break; @@ -1456,7 +1456,7 @@ void EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) { if (!R.getValueAsBit("ASTNode")) continue; - const std::vector<Record *> Supers = R.getSuperClasses(); + ArrayRef<Record *> Supers = R.getSuperClasses(); assert(!Supers.empty() && "Forgot to specify a superclass for the attr"); std::string SuperName; for (const auto *Super : llvm::make_range(Supers.rbegin(), Supers.rend())) { diff --git a/utils/analyzer/CmpRuns.py b/utils/analyzer/CmpRuns.py index a1f7a56..ce5ddfb 100755 --- a/utils/analyzer/CmpRuns.py +++ b/utils/analyzer/CmpRuns.py @@ -37,7 +37,7 @@ import CmpRuns class SingleRunInfo: def __init__(self, path, root="", verboseLog=None): self.path = path - self.root = root + self.root = root.rstrip("/\\") self.verboseLog = verboseLog class AnalysisDiagnostic: @@ -50,8 +50,8 @@ class AnalysisDiagnostic: def getFileName(self): root = self._report.run.root fileName = self._report.files[self._loc['file']] - if fileName.startswith(root) : - return fileName[len(root):] + if fileName.startswith(root) and len(root) > 0: + return fileName[len(root)+1:] return fileName def getLine(self): diff --git a/utils/analyzer/SATestBuild.py b/utils/analyzer/SATestBuild.py index 20839c2..2d91ba4 100644 --- a/utils/analyzer/SATestBuild.py +++ b/utils/analyzer/SATestBuild.py @@ -16,6 +16,7 @@ Repository Directory structure: - Project Dir2 - ReferenceOutput .. +Note that the build tree must be inside the project dir. To test the build of the analyzer one would: - Copy over a copy of the Repository Directory. (TODO: Prefer to ensure that @@ -337,6 +338,18 @@ def buildProject(Dir, SBOutputDir, ProjectBuildMode, IsReferenceBuild): if IsReferenceBuild : runCleanupScript(Dir, PBuildLogFile) + + # Make the absolute paths relative in the reference results. + for (DirPath, Dirnames, Filenames) in os.walk(SBOutputDir): + for F in Filenames: + if (not F.endswith('plist')): + continue + Plist = os.path.join(DirPath, F) + Data = plistlib.readPlist(Plist) + Paths = [SourceFile[len(Dir)+1:] if SourceFile.startswith(Dir)\ + else SourceFile for SourceFile in Data['files']] + Data['files'] = Paths + plistlib.writePlist(Data, Plist) finally: PBuildLogFile.close() @@ -450,7 +463,7 @@ def runCmpResults(Dir, Strictness = 0): print " Comparing Results: %s %s" % (RefDir, NewDir) DiffsPath = os.path.join(NewDir, DiffsSummaryFileName) - Opts = CmpRuns.CmpOptions(DiffsPath) + Opts = CmpRuns.CmpOptions(DiffsPath, "", Dir) # Discard everything coming out of stdout (CmpRun produces a lot of them). OLD_STDOUT = sys.stdout sys.stdout = Discarder() |