aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-17 14:01:34 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-17 14:01:34 -0800
commit3dd73e256fae2b0373ddb890f129942329fc6fa8 (patch)
tree80c185310be4bdd3dd59513cad41d8da374bc77f /lib
parent814f010b53e3c5647dc97f28b998ad5d895e7d58 (diff)
only emit declares with uses
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp2
1 files changed, 1 insertions, 1 deletions
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 {