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

Side by Side Diff: lib/CodeGen/CodeGenModule.cpp

Issue 1696583002: Remove Emscripten support (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « lib/Basic/Targets.cpp ('k') | lib/CodeGen/ItaniumCXXABI.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===--- CodeGenModule.cpp - Emit LLVM Code from ASTs for a Module --------===// 1 //===--- CodeGenModule.cpp - Emit LLVM Code from ASTs for a Module --------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This coordinates the per-module state used while generating code. 10 // This coordinates the per-module state used while generating code.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 using namespace clang; 56 using namespace clang;
57 using namespace CodeGen; 57 using namespace CodeGen;
58 58
59 static const char AnnotationSection[] = "llvm.metadata"; 59 static const char AnnotationSection[] = "llvm.metadata";
60 60
61 static CGCXXABI *createCXXABI(CodeGenModule &CGM) { 61 static CGCXXABI *createCXXABI(CodeGenModule &CGM) {
62 switch (CGM.getTarget().getCXXABI().getKind()) { 62 switch (CGM.getTarget().getCXXABI().getKind()) {
63 case TargetCXXABI::GenericAArch64: 63 case TargetCXXABI::GenericAArch64:
64 case TargetCXXABI::GenericARM: 64 case TargetCXXABI::GenericARM:
65 case TargetCXXABI::Emscripten: // @LOCALMOD Emscripten
66 case TargetCXXABI::iOS: 65 case TargetCXXABI::iOS:
67 case TargetCXXABI::iOS64: 66 case TargetCXXABI::iOS64:
68 case TargetCXXABI::GenericMIPS: 67 case TargetCXXABI::GenericMIPS:
69 case TargetCXXABI::GenericItanium: 68 case TargetCXXABI::GenericItanium:
70 return CreateItaniumCXXABI(CGM); 69 return CreateItaniumCXXABI(CGM);
71 case TargetCXXABI::Microsoft: 70 case TargetCXXABI::Microsoft:
72 return CreateMicrosoftCXXABI(CGM); 71 return CreateMicrosoftCXXABI(CGM);
73 } 72 }
74 73
75 llvm_unreachable("invalid C++ ABI kind"); 74 llvm_unreachable("invalid C++ ABI kind");
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 786
788 if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D)) 787 if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
789 F->setUnnamedAddr(true); 788 F->setUnnamedAddr(true);
790 else if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) 789 else if (const auto *MD = dyn_cast<CXXMethodDecl>(D))
791 if (MD->isVirtual()) 790 if (MD->isVirtual())
792 F->setUnnamedAddr(true); 791 F->setUnnamedAddr(true);
793 792
794 unsigned alignment = D->getMaxAlignment() / Context.getCharWidth(); 793 unsigned alignment = D->getMaxAlignment() / Context.getCharWidth();
795 if (alignment) 794 if (alignment)
796 F->setAlignment(alignment); 795 F->setAlignment(alignment);
797
798 // @LOCALMOD-START Emscripten
799 if (getTarget().getCXXABI().arePointersToMemberFunctionsAligned()) {
800 // C++ ABI requires 2-byte alignment for member functions.
801 if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D))
802 F->setAlignment(2);
803 }
804 // @LOCALMOD-END Emscripten
805 } 796 }
806 797
807 void CodeGenModule::SetCommonAttributes(const Decl *D, 798 void CodeGenModule::SetCommonAttributes(const Decl *D,
808 llvm::GlobalValue *GV) { 799 llvm::GlobalValue *GV) {
809 if (const auto *ND = dyn_cast<NamedDecl>(D)) 800 if (const auto *ND = dyn_cast<NamedDecl>(D))
810 setGlobalVisibility(GV, ND); 801 setGlobalVisibility(GV, ND);
811 else 802 else
812 GV->setVisibility(llvm::GlobalValue::DefaultVisibility); 803 GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
813 804
814 if (D->hasAttr<UsedAttr>()) 805 if (D->hasAttr<UsedAttr>())
(...skipping 2857 matching lines...) Expand 10 before | Expand all | Expand 10 after
3672 bool PerformInit = 3663 bool PerformInit =
3673 VD->getAnyInitializer() && 3664 VD->getAnyInitializer() &&
3674 !VD->getAnyInitializer()->isConstantInitializer(getContext(), 3665 !VD->getAnyInitializer()->isConstantInitializer(getContext(),
3675 /*ForRef=*/false); 3666 /*ForRef=*/false);
3676 if (auto InitFunction = getOpenMPRuntime().emitThreadPrivateVarDefinition( 3667 if (auto InitFunction = getOpenMPRuntime().emitThreadPrivateVarDefinition(
3677 VD, GetAddrOfGlobalVar(VD), RefExpr->getLocStart(), PerformInit)) 3668 VD, GetAddrOfGlobalVar(VD), RefExpr->getLocStart(), PerformInit))
3678 CXXGlobalInits.push_back(InitFunction); 3669 CXXGlobalInits.push_back(InitFunction);
3679 } 3670 }
3680 } 3671 }
3681 3672
OLDNEW
« 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