summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-16 13:34:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-16 13:34:04 +0000
commitab67b30df6b14e8e90f4778215ed4e1d5939638e (patch)
tree0dd738ae6d07cd9fac9f37bc7f34dbea1d7014c1 /unittests
parentb95580a711b70e373ba7a52b3867e7ea6881e413 (diff)
downloadllvm-ab67b30df6b14e8e90f4778215ed4e1d5939638e.tar.gz
llvm-ab67b30df6b14e8e90f4778215ed4e1d5939638e.tar.bz2
llvm-ab67b30df6b14e8e90f4778215ed4e1d5939638e.tar.xz
Change the GlobalAlias constructor to look a bit more like GlobalVariable.
This is part of the fix for pr10367. A GlobalAlias always has a pointer type, so just have the constructor build the type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/IR/VerifierTest.cpp5
-rw-r--r--unittests/Transforms/Utils/SpecialCaseList.cpp5
2 files changed, 5 insertions, 5 deletions
diff --git a/unittests/IR/VerifierTest.cpp b/unittests/IR/VerifierTest.cpp
index 0a660a6b91..92f25b3e37 100644
--- a/unittests/IR/VerifierTest.cpp
+++ b/unittests/IR/VerifierTest.cpp
@@ -52,9 +52,8 @@ TEST(VerifierTest, AliasUnnamedAddr) {
GlobalVariable *Aliasee = new GlobalVariable(M, Ty, true,
GlobalValue::ExternalLinkage,
Init, "foo");
- GlobalAlias *GA = new GlobalAlias(Type::getInt8PtrTy(C),
- GlobalValue::ExternalLinkage,
- "bar", Aliasee, &M);
+ auto *GA =
+ new GlobalAlias(Ty, GlobalValue::ExternalLinkage, "bar", Aliasee, &M);
GA->setUnnamedAddr(true);
std::string Error;
raw_string_ostream ErrorOS(Error);
diff --git a/unittests/Transforms/Utils/SpecialCaseList.cpp b/unittests/Transforms/Utils/SpecialCaseList.cpp
index 748834f85e..6863ea5a60 100644
--- a/unittests/Transforms/Utils/SpecialCaseList.cpp
+++ b/unittests/Transforms/Utils/SpecialCaseList.cpp
@@ -35,8 +35,9 @@ protected:
}
GlobalAlias *makeAlias(StringRef Name, GlobalValue *Aliasee) {
- return new GlobalAlias(Aliasee->getType(), GlobalValue::ExternalLinkage,
- Name, Aliasee, Aliasee->getParent());
+ return new GlobalAlias(Aliasee->getType()->getElementType(),
+ GlobalValue::ExternalLinkage, Name, Aliasee,
+ Aliasee->getParent());
}
SpecialCaseList *makeSpecialCaseList(StringRef List, std::string &Error) {