[PATCH] Fix unresolved linker symbols from misplaced extern definitions
Chuck Atkins via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 08:06:31 PDT 2016
Sorry for the typos in the first commit message
- Chuck <%28518%29%20881-1183>
On Fri, Sep 9, 2016 at 11:05 AM, Chuck Atkins <chuck.atkins at kitware.com>
wrote:
> When LCSSAID and LoopSimplifyID are declared extern inside a function body,
> some linkers will fail to resolve the actual symbnols defined in the llvm
> namespace. By removing the function local extern declarations and relying
> on the header definitions in Scalar.h, the symbols can be properly reolved.
> This is specifically an issue when building with the Intel compiler.
> ---
> lib/Transforms/Utils/LoopUtils.cpp | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/Transforms/Utils/LoopUtils.cpp
> b/lib/Transforms/Utils/LoopUtils.cpp
> index 8878689..9a7813f 100644
> --- a/lib/Transforms/Utils/LoopUtils.cpp
> +++ b/lib/Transforms/Utils/LoopUtils.cpp
> @@ -11,6 +11,7 @@
> //
> //===------------------------------------------------------
> ----------------===//
>
> +#include "llvm/Transforms/Scalar.h"
> #include "llvm/Transforms/Utils/LoopUtils.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> #include "llvm/Analysis/BasicAliasAnalysis.h"
> @@ -940,8 +941,6 @@ void llvm::getLoopAnalysisUsage(AnalysisUsage &AU) {
>
> // We must also preserve LoopSimplify and LCSSA. We locally access
> their IDs
> // here because users shouldn't directly get them from this header.
> - extern char &LoopSimplifyID;
> - extern char &LCSSAID;
> AU.addRequiredID(LoopSimplifyID);
> AU.addPreservedID(LoopSimplifyID);
> AU.addRequiredID(LCSSAID);
> --
> 2.7.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160909/d22c26a5/attachment.html>
More information about the llvm-commits
mailing list