diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2020-11-30 11:34:12 -0800 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2020-11-30 11:34:12 -0800 |
commit | fe431683484a3041e024ab2373bb707b1ca8d1cf (patch) | |
tree | cc85d6f2937d11170552e25d93c42ad9358c563f /llvm/unittests/Analysis/TargetLibraryInfoTest.cpp | |
parent | abef659a45fff4147f8f0ffd1d0f6600185e4a4e (diff) | |
download | llvm-fe431683484a3041e024ab2373bb707b1ca8d1cf.zip llvm-fe431683484a3041e024ab2373bb707b1ca8d1cf.tar.gz llvm-fe431683484a3041e024ab2373bb707b1ca8d1cf.tar.bz2 |
Creating a named struct requires only a Context and a name, but looking up a struct by name requires a Module. The method on Module merely accesses the LLVMContextImpl and no data from the module itself, so this patch moves getTypeByName to a static method on StructType that takes a Context and a name.
There's a small number of users of this function, they are all updated.
This updates the C API adding a new method LLVMGetTypeByName2 that takes a context and a name.
Differential Revision: https://reviews.llvm.org/D78793
Diffstat (limited to 'llvm/unittests/Analysis/TargetLibraryInfoTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/TargetLibraryInfoTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp index 6e57a1b..08e3de9 100644 --- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp +++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp @@ -61,7 +61,7 @@ protected: TEST_F(TargetLibraryInfoTest, InvalidProto) { parseAssembly("%foo = type { %foo }\n"); - auto *StructTy = M->getTypeByName("foo"); + auto *StructTy = StructType::getTypeByName(Context, "foo"); auto *InvalidFTy = FunctionType::get(StructTy, /*isVarArg=*/false); for (unsigned FI = 0; FI != LibFunc::NumLibFuncs; ++FI) { |