aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/JSBackend/JSBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/JSBackend/JSBackend.cpp')
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index eb3a6d1929..f9f3633bcd 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -1887,21 +1887,6 @@ void JSWriter::printModuleBody() {
nl(Out) << "// EMSCRIPTEN_START_FUNCTIONS"; nl(Out);
for (Module::const_iterator I = TheModule->begin(), E = TheModule->end();
I != E; ++I) {
- // Ignore intrinsics that are always no-ops. We don't emit any code for
- // them, so we don't need to declare them.
- if (I->isIntrinsic()) {
- switch (I->getIntrinsicID()) {
- case Intrinsic::dbg_declare:
- case Intrinsic::dbg_value:
- case Intrinsic::lifetime_start:
- case Intrinsic::lifetime_end:
- case Intrinsic::invariant_start:
- case Intrinsic::invariant_end:
- case Intrinsic::prefetch:
- continue;
- }
- }
-
if (!I->isDeclaration()) printFunction(I);
}
Out << "function runPostSets() {\n";
@@ -1934,6 +1919,21 @@ void JSWriter::printModuleBody() {
for (Module::const_iterator I = TheModule->begin(), E = TheModule->end();
I != E; ++I) {
if (I->isDeclaration() && !I->use_empty()) {
+ // Ignore intrinsics that are always no-ops. We don't emit any code for
+ // them, so we don't need to declare them.
+ if (I->isIntrinsic()) {
+ switch (I->getIntrinsicID()) {
+ case Intrinsic::dbg_declare:
+ case Intrinsic::dbg_value:
+ case Intrinsic::lifetime_start:
+ case Intrinsic::lifetime_end:
+ case Intrinsic::invariant_start:
+ case Intrinsic::invariant_end:
+ case Intrinsic::prefetch:
+ continue;
+ }
+ }
+
if (first) {
first = false;
} else {