aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp5
-rw-r--r--lib/Transforms/NaCl/PNaClABISimplify.cpp4
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index 65504326b0..856a051fe9 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -950,6 +950,11 @@ std::string JSWriter::getConstant(const Constant* CV, AsmCast sign) {
Externals.insert(Name);
return Name;
}
+ if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(CV)) {
+ // Since we don't currently support linking of our output, we don't need
+ // to worry about weak or other kinds of aliases.
+ return getConstant(GA->getAliasee(), sign);
+ }
return utostr(getGlobalAddress(GV->getName().str()));
}
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 5678ffaa7f..886e0cc4cc 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -77,13 +77,17 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) {
PM.add(createExpandVarArgsPass());
PM.add(createExpandCtorsPass());
+#if 0 // XXX EMSCRIPTEN: We handle aliases.
PM.add(createResolveAliasesPass());
+#endif
#if 0 // EMSCRIPTEN: no need for tls
PM.add(createExpandTlsPass());
#endif
// GlobalCleanup needs to run after ExpandTls because
// __tls_template_start etc. are extern_weak before expansion
+#if 0 // XXX EMSCRIPTEN: We don't currently have tls, and we don't have the same complications with extern_weak
PM.add(createGlobalCleanupPass());
+#endif
}
void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) {