aykevl created this revision. aykevl added reviewers: dylanmckay, rsmith, rjmccall. Herald added subscribers: cfe-commits, Jim. Herald added a project: clang.
This fixes code like the following on AVR: void foo(void) { } void bar(void) __attribute__((alias("foo"))); Code like this is present in compiler-rt, which I'm trying to build. --- I'm not sure how to add a test for this, are there any examples I can look at? And does this need a test at all, considering how trivial the change is? Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D76182 Files: clang/lib/CodeGen/CodeGenModule.cpp Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -4547,8 +4547,9 @@ } // Create the new alias itself, but don't set a name yet. + unsigned AS = cast<llvm::PointerType>(Aliasee->getType())->getAddressSpace(); auto *GA = - llvm::GlobalAlias::create(DeclTy, 0, LT, "", Aliasee, &getModule()); + llvm::GlobalAlias::create(DeclTy, AS, LT, "", Aliasee, &getModule()); if (Entry) { if (GA->getAliasee() == Entry) {
Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -4547,8 +4547,9 @@ } // Create the new alias itself, but don't set a name yet. + unsigned AS = cast<llvm::PointerType>(Aliasee->getType())->getAddressSpace(); auto *GA = - llvm::GlobalAlias::create(DeclTy, 0, LT, "", Aliasee, &getModule()); + llvm::GlobalAlias::create(DeclTy, AS, LT, "", Aliasee, &getModule()); if (Entry) { if (GA->getAliasee() == Entry) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits