This is an archive of the discontinued LLVM Phabricator instance.

Fix unresolved linker symbols from misplaced extern definitions
AcceptedPublic

Authored by chuckatkins on Sep 16 2016, 8:32 AM.

Details

Reviewers
majnemer
Summary

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.

Event Timeline

chuckatkins retitled this revision from to Fix unresolved linker symbols from misplaced extern definitions.
chuckatkins updated this object.

Fix unresolved linker symbols from un-namespaced extern definitions

When LCSSAID and LoopSimplifyID are declared extern inside a function body,
some linkers will fail to resolve the actual symbols defined in the llvm
namespace. By removing the function local extern declarations and moving
them to outside the function body, the symbols can be properly resolved.
This is specifically an issue when building with the Intel compiler.

majnemer added inline comments.Sep 26 2016, 9:14 AM
lib/Transforms/Utils/LoopUtils.cpp
934–938

Please clang-format this.

Adjusted code style with clang-format

majnemer accepted this revision.Oct 3 2016, 2:45 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 3 2016, 2:45 PM