Skip to content
Snippets Groups Projects
Commit 01692f0f authored by David Blaikie's avatar David Blaikie
Browse files

Modular Codegen: Include testing for inline asm as well as some commentary on...

Modular Codegen: Include testing for inline asm as well as some commentary on the implementaiton choice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300106 91177308-0d34-0410-b5e6-96231b3b80d8
parent 0f4fb48b
No related branches found
No related tags found
No related merge requests found
...@@ -28,3 +28,5 @@ inline void inst_decl() { ...@@ -28,3 +28,5 @@ inline void inst_decl() {
(void)sizeof(&inst<int>); (void)sizeof(&inst<int>);
inst<float>(); inst<float>();
} }
asm("narf");
...@@ -6,6 +6,20 @@ RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -fmodules-debuginfo - ...@@ -6,6 +6,20 @@ RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -fmodules-debuginfo -
RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s
RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s
For want of any better definition, inline asm goes "everywhere" the same as it
if it were in a header (with the disadvantage that the inline asm will be
included in the program if the module is used, even if the header containing
the inline asm is never included - unlike a non-modular build).
This is inconsistent with how namespace scope static variables are handled -
where they only appear in the code that includes a header. This functionality
was implemented to workaround/support the initialization of iostreams
(implemented as a namespace scope static in the header - only to be provided
when that specific header is included in the program).
FOO: module asm "narf"
USE: module asm "narf"
FOO: $_Z2f1PKcz = comdat any FOO: $_Z2f1PKcz = comdat any
FOO: $_ZN13implicit_dtorD1Ev = comdat any FOO: $_ZN13implicit_dtorD1Ev = comdat any
USE: $_Z4instIiEvv = comdat any USE: $_Z4instIiEvv = comdat any
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment