From 3dd73e256fae2b0373ddb890f129942329fc6fa8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Feb 2014 14:01:34 -0800 Subject: only emit declares with uses --- lib/Target/JSBackend/JSBackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index 97f4be7c92..a8530b1b1f 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -1758,7 +1758,7 @@ void JSWriter::printModuleBody() { bool first = true; for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); I != E; ++I) { - if (I->isDeclaration()) { + if (I->isDeclaration() && I->hasNUsesOrMore(1)) { if (first) { first = false; } else { -- cgit v1.2.3-18-g5258