[llvm] [tools] LLVM Compiler Visualization Tool for Offloading - GSoC 2025 (PR #147451)

Kevin Sala Penades via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 11:58:53 PDT 2025


Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>,
Miguel =?utf-8?q?Cárdenas?= <miguelecsx at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/147451 at github.com>


================
@@ -0,0 +1,74 @@
+//===------------------- CompilationUnit.h - LLVM Advisor -----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the CompilationUnit code generator driver. It provides a convenient
+// command-line interface for generating an assembly file or a relocatable file,
+// given LLVM bitcode.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_ADVISOR_CORE_COMPILATIONUNIT_H
+#define LLVM_ADVISOR_CORE_COMPILATIONUNIT_H
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
+#include <string>
+#include <unordered_map>
+
+namespace llvm {
+namespace advisor {
+
+struct SourceFile {
+  std::string path;
+  std::string language;
+  bool isHeader = false;
+  llvm::SmallVector<std::string, 8> dependencies;
+};
+
+struct CompilationUnitInfo {
+  std::string name;
+  llvm::SmallVector<SourceFile, 4> sources;
+  llvm::SmallVector<std::string, 8> compileFlags;
----------------
kevinsala wrote:

The code is full of SmallVector types with hard-coded size. Is this actually necessary? If so, you could use a `using` or `typedef`.

https://github.com/llvm/llvm-project/pull/147451


More information about the llvm-commits mailing list