[all-commits] [llvm/llvm-project] f21c08: CodeGen: Allow annotations on globals in non-zero ...
Nicolai Hähnle via All-commits
all-commits at lists.llvm.org
Wed Dec 11 04:24:40 PST 2019
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: f21c081b78ec7a83a79137c65edd58874b262761
https://github.com/llvm/llvm-project/commit/f21c081b78ec7a83a79137c65edd58874b262761
Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date: 2019-12-11 (Wed, 11 Dec 2019)
Changed paths:
M clang/lib/CodeGen/CodeGenModule.cpp
M clang/test/CodeGen/annotations-global.c
Log Message:
-----------
CodeGen: Allow annotations on globals in non-zero address space
Summary:
Attribute annotations are recorded in a special global composite variable
that points to annotation strings and the annotated objects.
As a restriction of the LLVM IR type system, those pointers are all
pointers to address space 0, so let's insert an addrspacecast when the
annotated global is in a non-0 address space.
Since this addrspacecast is only reachable from the global annotations
object, this should allow us to represent annotations on all globals
regardless of which addrspacecasts are usually legal for the target.
Reviewers: rjmccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71208
More information about the All-commits
mailing list