aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-04-12 13:09:00 -0700
committerDerek Schuff <dschuff@chromium.org>2013-04-12 13:09:00 -0700
commit23da4c2957a29624ef0a759bf5a35516b4985f6f (patch)
tree5cea0039daa7a86782e51d5a1e0d040ca0a67b44 /lib/Transforms
parent14551e67a9ac4e521b9dd5f7776bb1a4fdcd7998 (diff)
PNaCl: extend GlobalCleanup to null-out extern_weak function references, and extend the ABI checker to verify.
Also promote weak symbols to internal ones, which was required because the scons barebones tests define weak versions of memcpy/memset BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339 TEST= llvm-regression (globalcleanup.ll), scons barebones tests Review URL: https://codereview.chromium.org/13989005
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/NaCl/GlobalCleanup.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/GlobalCleanup.cpp b/lib/Transforms/NaCl/GlobalCleanup.cpp
index 9a28063af6..00e15b39a5 100644
--- a/lib/Transforms/NaCl/GlobalCleanup.cpp
+++ b/lib/Transforms/NaCl/GlobalCleanup.cpp
@@ -56,6 +56,10 @@ static bool CleanUpLinkage(GlobalValue *GV) {
GV->eraseFromParent();
return true;
}
+ case GlobalValue::WeakAnyLinkage: {
+ GV->setLinkage(GlobalValue::InternalLinkage);
+ return true;
+ }
default:
// default with fall through to avoid compiler warning
return false;
@@ -80,6 +84,11 @@ bool GlobalCleanup::runOnModule(Module &M) {
GlobalVariable *GV = I++;
Modified |= CleanUpLinkage(GV);
}
+
+ for (Module::iterator I = M.begin(), E = M.end(); I != E; ) {
+ Function *F = I++;
+ Modified |= CleanUpLinkage(F);
+ }
return Modified;
}