|
|
|||
File indexing completed on 2026-05-10 08:36:26
0001 //===---------- IssueHash.h - Generate identification hashes ----*- C++ -*-===// 0002 // 0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 0004 // See https://llvm.org/LICENSE.txt for license information. 0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 0006 // 0007 //===----------------------------------------------------------------------===// 0008 #ifndef LLVM_CLANG_ANALYSIS_ISSUEHASH_H 0009 #define LLVM_CLANG_ANALYSIS_ISSUEHASH_H 0010 0011 #include "llvm/ADT/SmallString.h" 0012 0013 namespace clang { 0014 class Decl; 0015 class FullSourceLoc; 0016 class LangOptions; 0017 0018 /// Returns an opaque identifier for a diagnostic. 0019 /// 0020 /// This opaque identifier is intended to be stable even when the source code 0021 /// is changed. It allows to track diagnostics in the long term, for example, 0022 /// find which diagnostics are "new", maintain a database of suppressed 0023 /// diagnostics etc. 0024 /// 0025 /// We may introduce more variants of issue hashes in the future 0026 /// but older variants will still be available for compatibility. 0027 /// 0028 /// This hash is based on the following information: 0029 /// - Name of the checker that emitted the diagnostic. 0030 /// - Warning message. 0031 /// - Name of the enclosing declaration. 0032 /// - Contents of the line of code with the issue, excluding whitespace. 0033 /// - Column number (but not the line number! - which makes it stable). 0034 llvm::SmallString<32> getIssueHash(const FullSourceLoc &IssueLoc, 0035 llvm::StringRef CheckerName, 0036 llvm::StringRef WarningMessage, 0037 const Decl *IssueDecl, 0038 const LangOptions &LangOpts); 0039 0040 /// Get the unhashed string representation of the V1 issue hash. 0041 /// When hashed, it becomes the actual issue hash. Useful for testing. 0042 /// See GetIssueHashV1() for more information. 0043 std::string getIssueString(const FullSourceLoc &IssueLoc, 0044 llvm::StringRef CheckerName, 0045 llvm::StringRef WarningMessage, 0046 const Decl *IssueDecl, const LangOptions &LangOpts); 0047 } // namespace clang 0048 0049 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|