Skip to content

Commit 676106a

Browse files
committed
pragma section.
1 parent d8eb4ac commit 676106a

File tree

11 files changed

+5294
-34
lines changed

11 files changed

+5294
-34
lines changed

clang/include/clang/AST/ASTContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,7 @@ OPT_LIST(V)
35583558
PSF_Execute = 0x4,
35593559
PSF_Implicit = 0x8,
35603560
PSF_ZeroInit = 0x10,
3561+
PSF_Shared = 0x20,
35613562
PSF_Invalid = 0x80000000U,
35623563
};
35633564

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,6 +3836,9 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
38363836
if (Global->hasAttr<CPUDispatchAttr>())
38373837
return emitCPUDispatchDefinition(GD);
38383838

3839+
if (Global->hasAttr<SectionAttr>())
3840+
printf("here \n");
3841+
38393842
// If this is CUDA, be selective about which declarations we emit.
38403843
// Non-constexpr non-lambda implicit host device functions are not emitted
38413844
// unless they are used on device side.
@@ -5696,6 +5699,10 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D,
56965699
const ASTContext::SectionInfo &SI = Context.SectionInfos[SA->getName()];
56975700
if ((SI.SectionFlags & ASTContext::PSF_Write) == 0)
56985701
GV->setConstant(true);
5702+
if ((SI.SectionFlags & ASTContext::PSF_Execute) != 0)
5703+
GV->setExecute(true);
5704+
if ((SI.SectionFlags & ASTContext::PSF_Shared) != 0)
5705+
GV->setShared(true);
56995706
}
57005707

57015708
CharUnits AlignVal = getContext().getDeclAlign(D);

0 commit comments

Comments
 (0)