Conversation
.gitignore
Outdated
|
|
||
| # Nested build directory | ||
| /build* | ||
| /build* |
There was a problem hiding this comment.
Please revert unnecessary whitespace changes.
foo_00.ll
Outdated
|
|
||
| namespace llvm { | ||
|
|
||
| class DebugRecordCounterPass : public PassInfoMixin<DebugRecordCounterPass> { |
There was a problem hiding this comment.
Please format all added code using git-clang-format.
llvm/lib/CMakeLists.txt
Outdated
| endif() | ||
|
|
||
| # Component post-processing | ||
| # Component post-processing |
| #include "llvm/Transforms/Vectorize/SLPVectorizer.h" | ||
| #include "llvm/Transforms/Vectorize/VectorCombine.h" | ||
|
|
||
| #include "llvm/Transforms/Utils/DebugRecordDeleter.h" |
There was a problem hiding this comment.
This include can be grouped with the previous ones.
|
|
||
| if (isLTOPreLink(Phase)) | ||
| addRequiredLTOPreLinkPasses(MPM); | ||
| addRequiredLTOPreLinkPasses(MPM); |
| // build/bin/opt -disable-output /home/ana-marija/Documents/foo_00.ll -passes=dbg-counter | ||
| PreservedAnalyses DebugRecordCounterPass::run(Module &M, ModuleAnalysisManager &AM) { | ||
|
|
||
| int dbg_values, dbg_declares, dbg_assigns; |
| int dbg_values, dbg_declares, dbg_assigns; | ||
|
|
||
| for (Function &F : M) { | ||
| errs() << "Function: " << F.getName() << "\n"; |
There was a problem hiding this comment.
Investigate the LLVM_DEBUG macro to print output only when specified by the -debug-only=[name] option.
|
|
||
| return PreservedAnalyses::all(); | ||
|
|
||
| } No newline at end of file |
There was a problem hiding this comment.
There is a missing newline at the end of this and some other files.
| PreservedAnalyses DebugRecordDeleterPass::run(Module &M, | ||
| ModuleAnalysisManager &AM) { | ||
|
|
||
| bool modified = StripDebugInfo(M); |
There was a problem hiding this comment.
This will remove all debug information, not just the debug record instructions. Also, modified is unused.
| !33 = !DILocation(line: 13, column: 6, scope: !31) | ||
| !34 = !DILocation(line: 13, column: 10, scope: !31) | ||
| !35 = !DILocation(line: 14, column: 9, scope: !31) | ||
| !36 = !DILocation(line: 14, column: 2, scope: !31) No newline at end of file |
There was a problem hiding this comment.
There are missing newlines at the end of test files.
| !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) | ||
| !1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true) | ||
| !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 22.0.0git (https://github.com/anamaoh/llvm-project.git 782a91e1fc94d9c82495f60afc5ed5edd72de776)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None) | ||
| !3 = !DIFile(filename: "/home/ana-marija/Documents/load.cpp", directory: "/home/ana-marija/Desktop/LLVM/llvm-project", checksumkind: CSK_MD5, checksum: "1bce1e274606359bd3ee799e44db5ab7") |
There was a problem hiding this comment.
Please use dummy paths throughout tests. Consult DebugInfo tests for reference.
| #define DEBUG_TYPE "counter" | ||
| #include "llvm/Support/Debug.h" |
There was a problem hiding this comment.
DEBUG_TYPE should be defined after all includes.
No description provided.