From 8e4f4390bc3e6ed0ec72281c67950f54474f915d Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 20 Dec 2010 10:57:01 +0000 Subject: [PATCH] Discourage people from using isWeakForLinker when they should be using mayBeOverridden. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122241 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/GlobalValue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 62e84f83351..68cb8e2604c 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -173,7 +173,9 @@ public: } /// isWeakForLinker - Whether the definition of this global may be replaced at - /// link time. + /// link time. NB: Using this method outside of the code generators is almost + /// always a mistake: when working at the IR level use mayBeOverridden instead + /// as it knows about ODR semantics. static bool isWeakForLinker(LinkageTypes Linkage) { return Linkage == AvailableExternallyLinkage || Linkage == WeakAnyLinkage ||