Fix-forward build error from #132489
Replace deprecated use of getDeclaration that was added in #132489
llvm/lib/IR/AutoUpgrade.cpp:1480:26: error: 'getDeclaration' is deprecated: Use getOrInsertDeclaration instead [-Werror,-Wdeprecated-declarations]
1480 | NewFn = Intrinsic::getDeclaration(
| ^~~~~~~~~~~~~~
| getOrInsertDeclaration
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index acbc6ca..9091e75 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1477,7 +1477,7 @@
case 't':
if (Name == "thread.pointer") {
- NewFn = Intrinsic::getDeclaration(
+ NewFn = Intrinsic::getOrInsertDeclaration(
F->getParent(), Intrinsic::thread_pointer, F->getReturnType());
return true;
}