diff options
author | John McCall <rjmccall@apple.com> | 2010-02-08 21:46:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-08 21:46:50 +0000 |
commit | 340aafaac6c2291ece78d1c31a00ddfccf71ddd3 (patch) | |
tree | 95481d964a64c0cbbaec97cdf5ecf06ae92f89e4 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | d0450d90b3675a090d7cf657772b8b9924b24352 (diff) | |
download | bcm5719-llvm-340aafaac6c2291ece78d1c31a00ddfccf71ddd3.tar.gz bcm5719-llvm-340aafaac6c2291ece78d1c31a00ddfccf71ddd3.zip |
Emit global references with constant initializers as constants. Fixes PR5585.
The standard actually says that such references should have internal linkage,
but gcc doesn't do that, so we probably can't get away with it.
llvm-svn: 95577
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c5d84d74db8..a6b546ef9ef 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -783,7 +783,7 @@ CodeGenModule::CreateRuntimeFunction(const llvm::FunctionType *FTy, } static bool DeclIsConstantGlobal(ASTContext &Context, const VarDecl *D) { - if (!D->getType().isConstant(Context)) + if (!D->getType().isConstant(Context) && !D->getType()->isReferenceType()) return false; if (Context.getLangOptions().CPlusPlus && Context.getBaseElementType(D->getType())->getAs<RecordType>()) { |