diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-17 19:57:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-17 19:57:46 +0000 |
commit | fbd8cc09269d6c7c5ca615a4757e41899a18283f (patch) | |
tree | 62261699c646bafd5ce35168f471b5e4f1f91b2f /unittests | |
parent | a2f821964637856c4fea48f3f44a863ebbf181b7 (diff) | |
download | llvm-fbd8cc09269d6c7c5ca615a4757e41899a18283f.tar.gz llvm-fbd8cc09269d6c7c5ca615a4757e41899a18283f.tar.bz2 llvm-fbd8cc09269d6c7c5ca615a4757e41899a18283f.tar.xz |
Reduce abuse of default values in the GlobalAlias constructor.
This is in preparation for adding an optional offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/IR/ConstantsTest.cpp | 3 | ||||
-rw-r--r-- | unittests/IR/VerifierTest.cpp | 3 | ||||
-rw-r--r-- | unittests/Transforms/Utils/SpecialCaseList.cpp | 4 |
3 files changed, 3 insertions, 7 deletions
diff --git a/unittests/IR/ConstantsTest.cpp b/unittests/IR/ConstantsTest.cpp index b225ba923b..abab122022 100644 --- a/unittests/IR/ConstantsTest.cpp +++ b/unittests/IR/ConstantsTest.cpp @@ -274,8 +274,7 @@ TEST(ConstantsTest, ReplaceInAliasTest) { Type *Int32Ty = Type::getInt32Ty(getGlobalContext()); auto *Global = cast<GlobalObject>(M->getOrInsertGlobal("dummy", Int32Ty)); - auto *GA = new GlobalAlias(Int32Ty, GlobalValue::ExternalLinkage, "alias", - Global, M.get()); + auto *GA = new GlobalAlias(GlobalValue::ExternalLinkage, "alias", Global); EXPECT_DEATH(Global->replaceAllUsesWith(GA), "replaceAliasUseWith cannot form an alias cycle"); } diff --git a/unittests/IR/VerifierTest.cpp b/unittests/IR/VerifierTest.cpp index 92f25b3e37..3499bc315e 100644 --- a/unittests/IR/VerifierTest.cpp +++ b/unittests/IR/VerifierTest.cpp @@ -52,8 +52,7 @@ TEST(VerifierTest, AliasUnnamedAddr) { GlobalVariable *Aliasee = new GlobalVariable(M, Ty, true, GlobalValue::ExternalLinkage, Init, "foo"); - auto *GA = - new GlobalAlias(Ty, GlobalValue::ExternalLinkage, "bar", Aliasee, &M); + auto *GA = new GlobalAlias(GlobalValue::ExternalLinkage, "bar", Aliasee); 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 ea8fb3962b..190167d0c1 100644 --- a/unittests/Transforms/Utils/SpecialCaseList.cpp +++ b/unittests/Transforms/Utils/SpecialCaseList.cpp @@ -35,9 +35,7 @@ protected: } GlobalAlias *makeAlias(StringRef Name, GlobalObject *Aliasee) { - return new GlobalAlias(Aliasee->getType()->getElementType(), - GlobalValue::ExternalLinkage, Name, Aliasee, - Aliasee->getParent()); + return new GlobalAlias(GlobalValue::ExternalLinkage, Name, Aliasee); } SpecialCaseList *makeSpecialCaseList(StringRef List, std::string &Error) { |