Skip to content

Commit 1321df6

Browse files
committed
Cleaned up a few things.
1 parent affe526 commit 1321df6

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,9 +3836,6 @@ 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-
38423839
// If this is CUDA, be selective about which declarations we emit.
38433840
// Non-constexpr non-lambda implicit host device functions are not emitted
38443841
// unless they are used on device side.

clang/test/CodeGenCXX/sections.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ __declspec(allocate("short_section")) short short_var = 42;
102102
struct t2 { t2(); };
103103
extern const t2 non_trivial_ctor;
104104
__declspec(allocate("non_trivial_ctor_section")) const t2 non_trivial_ctor_var;
105+
#pragma section("mysec", shared)
106+
int j = 0;
107+
__declspec(allocate("mysec")) int k = 0;
108+
extern __declspec(allocate("mysec")) int var = 10;
105109
}
106110

107111

@@ -130,6 +134,9 @@ __declspec(allocate("non_trivial_ctor_section")) const t2 non_trivial_ctor_var;
130134
//CHECK: @long_var = dso_local global i32 42, section "long_section"
131135
//CHECK: @short_var = dso_local global i16 42, section "short_section"
132136
//CHECK: @non_trivial_ctor_var = internal global %struct.t2 zeroinitializer, section "non_trivial_ctor_section"
137+
//CHECK: @j = dso_local global i32 0, section ".data", align 4
138+
//CHECK: @k = dso_local constant i32 0, section "mysec", align 4
139+
//CHECK: @var = dso_local constant i32 10, section "mysec", align 4
133140
//CHECK: define dso_local void @g()
134141
//CHECK: define dso_local void @h() {{.*}} section ".my_code"
135142
//CHECK: define dso_local void @h2() {{.*}} section ".my_code"

clang/test/CodeGenCXX/t1.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)