summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-28 22:17:59 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-28 22:17:59 +0000
commitf5563f573675f1b0b30884185cc52e611e97bd6c (patch)
tree6c0d74c4d1ca31c07c2830b15b7b7f5d9d7503ea /lib/CodeGen/CodeGenModule.h
parentec47c9130c83eabfa9460651da30eefeac297f62 (diff)
downloadclang-f5563f573675f1b0b30884185cc52e611e97bd6c.tar.gz
clang-f5563f573675f1b0b30884185cc52e611e97bd6c.tar.bz2
clang-f5563f573675f1b0b30884185cc52e611e97bd6c.tar.xz
CodeGen: Fix linkage of reference temporaries
Summary: A reference temporary should inherit the linkage of the variable it initializes. Otherwise, we may hit cases where a reference temporary wouldn't have the same value in all translation units. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3515 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r--lib/CodeGen/CodeGenModule.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 0fd325b083..419324d7d8 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -979,11 +979,16 @@ public:
/// the given LLVM type.
CharUnits GetTargetTypeStoreSize(llvm::Type *Ty) const;
- /// GetLLVMLinkageVarDefinition - Returns LLVM linkage for a global
- /// variable.
- llvm::GlobalValue::LinkageTypes
- GetLLVMLinkageVarDefinition(const VarDecl *D, bool isConstant);
-
+ /// getLLVMLinkageforDeclarator - Returns LLVM linkage for a declarator.
+ llvm::GlobalValue::LinkageTypes
+ getLLVMLinkageforDeclarator(const DeclaratorDecl *D, GVALinkage Linkage,
+ bool IsConstantVariable,
+ bool UseThunkForDtorVariant);
+
+ /// getLLVMLinkageVarDefinition - Returns LLVM linkage for a declarator.
+ llvm::GlobalValue::LinkageTypes
+ getLLVMLinkageVarDefinition(const VarDecl *VD, bool IsConstant);
+
/// Emit all the global annotations.
void EmitGlobalAnnotations();