Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Unified Diff: lib/CodeGen/CodeGenModule.cpp

Issue 1022123003: clang: add support for asmjs arch and Emscripten OS (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-clang.git@master
Patch Set: Address comments. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Basic/Targets.cpp ('k') | lib/CodeGen/ItaniumCXXABI.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/CodeGen/CodeGenModule.cpp
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index b6f1f4c97c79134b33e7fa65ecb5715428f6e1e1..dea71c867fe4934c8d0e7a0dab485182304651f8 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -62,6 +62,7 @@ static CGCXXABI *createCXXABI(CodeGenModule &CGM) {
switch (CGM.getTarget().getCXXABI().getKind()) {
case TargetCXXABI::GenericAArch64:
case TargetCXXABI::GenericARM:
+ case TargetCXXABI::Emscripten: // @LOCALMOD Emscripten
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
case TargetCXXABI::GenericItanium:
@@ -787,9 +788,13 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
if (alignment)
F->setAlignment(alignment);
- // C++ ABI requires 2-byte alignment for member functions.
- if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D))
- F->setAlignment(2);
+ // @LOCALMOD-START Emscripten
+ if (getTarget().getCXXABI().arePointersToMemberFunctionsAligned()) {
+ // C++ ABI requires 2-byte alignment for member functions.
+ if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D))
+ F->setAlignment(2);
+ }
+ // @LOCALMOD-END Emscripten
}
void CodeGenModule::SetCommonAttributes(const Decl *D,
« no previous file with comments | « lib/Basic/Targets.cpp ('k') | lib/CodeGen/ItaniumCXXABI.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698