aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-03-27 04:46:14 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-03-27 04:46:14 +0000
commit65687600908a23fc510600d6bec06238fd2cc9d5 (patch)
treef616a8328447cc4cd5fdc772c044f5dedfd703dc /clang/lib/CodeGen/CodeGenModule.cpp
parent1dbc7a7a5a4836f84d7304762ba93da34a339c52 (diff)
downloadllvm-65687600908a23fc510600d6bec06238fd2cc9d5.zip
llvm-65687600908a23fc510600d6bec06238fd2cc9d5.tar.gz
llvm-65687600908a23fc510600d6bec06238fd2cc9d5.tar.bz2
Use the correct alignment for uuid descriptors
The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit builds: we should do the same if the linker picks the "wrong" COMDAT. llvm-svn: 264530
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 399b739..435d646 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1458,8 +1458,8 @@ ConstantAddress CodeGenModule::GetAddrOfUuidDescriptor(
std::string Name = "_GUID_" + Uuid.lower();
std::replace(Name.begin(), Name.end(), '-', '_');
- // Contains a 32-bit field.
- CharUnits Alignment = CharUnits::fromQuantity(4);
+ // The UUID descriptor should be pointer aligned.
+ CharUnits Alignment = CharUnits::fromQuantity(PointerAlignInBytes);
// Look for an existing global.
if (llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name))