diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:51:45 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 18:51:17 -0800 |
commit | 8346647dd5ddc2d1f379cc530b20494a41e6ef31 (patch) | |
tree | d8445f8dbc4b8544e244cf8af53a27905ba2d064 /lib | |
parent | 7b62a180c6985b59ee7df38d3e7358ba574ad7c8 (diff) |
Don't run a pass to strip dead prototypes; just ignore them.
Also, fix the code for supressing declarations for no-op intrinsics.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 30 | ||||
-rw-r--r-- | lib/Transforms/NaCl/PNaClABISimplify.cpp | 2 |
2 files changed, 17 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 { diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 27dd45e1ea..a78bf3ef40 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -158,7 +158,9 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) { // Strip dead prototytes to appease the intrinsic ABI checks. // ExpandVarArgs leaves around vararg intrinsics, and // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. +#if 0 // XXX EMSCRIPTEN: We just ignore dead prototypes. PM.add(createStripDeadPrototypesPass()); +#endif // Eliminate simple dead code that the post-opt passes could have // created. |