Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?= <[email protected]>, Juan Manuel Martinez =?utf-8?q?Caamaño?=, Juan Manuel Martinez =?utf-8?q?Caamaño?=, Juan Manuel Martinez =?utf-8?q?Caamaño?=, Juan Manuel Martinez =?utf-8?q?Caamaño?=, Juan Manuel Martinez =?utf-8?q?Caamaño?=, Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================ @@ -0,0 +1,82 @@ +//===- UsedGlobalTest.cpp - Unit tests for Module utility ----------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// +#include "llvm/AsmParser/Parser.h" +#include "llvm/IR/Module.h" +#include "llvm/Support/SourceMgr.h" +#include "gtest/gtest.h" + +using namespace llvm; + +static std::unique_ptr<Module> parseIR(LLVMContext &C, StringRef IR) { + SMDiagnostic Err; + std::unique_ptr<Module> Mod = parseAssemblyString(IR, Err, C); + if (!Mod) + Err.print("UsedGlobalTest", errs()); + return Mod; +} + +static int getListSize(Module &M, StringRef Name) { + auto *List = M.getGlobalVariable(Name); ---------------- arsenm wrote: ```suggestion const GlobalVariable *List = M.getGlobalVariable(Name); ``` https://github.com/llvm/llvm-project/pull/162660 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
