[llvm] r231726 - [Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
Lang Hames
lhames at gmail.com
Tue Mar 10 18:23:57 PDT 2015
Sorry about that!
echristo picked up this issue and reverted the offending commits in
r231731. I've reapplied them, with the fix identified by dblaikie, in
r231896.
- Lang.
On Tue, Mar 10, 2015 at 11:36 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> ----- Original Message -----
> > From: "Lang Hames" <lhames at gmail.com>
> > To: llvm-commits at cs.uiuc.edu
> > Sent: Monday, March 9, 2015 6:51:09 PM
> > Subject: [llvm] r231726 - [Orc][MCJIT][RuntimeDyld] Add header that was
> accidentally left out of r231724.
> >
> > Author: lhames
> > Date: Mon Mar 9 18:51:09 2015
> > New Revision: 231726
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=231726&view=rev
> > Log:
> > [Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out
> > of r231724.
> >
> > Added:
> > llvm/trunk/include/llvm/ExecutionEngine/JITSymbolFlags.h
> >
> > Added: llvm/trunk/include/llvm/ExecutionEngine/JITSymbolFlags.h
> > URL:
> >
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITSymbolFlags.h?rev=231726&view=auto
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/ExecutionEngine/JITSymbolFlags.h (added)
> > +++ llvm/trunk/include/llvm/ExecutionEngine/JITSymbolFlags.h Mon Mar
> > 9 18:51:09 2015
> > @@ -0,0 +1,81 @@
> > +//===------ JITSymbolFlags.h - Flags for symbols in the JIT -----*-
> > C++ -*-===//
> > +//
> > +// The LLVM Compiler Infrastructure
> > +//
> > +// This file is distributed under the University of Illinois Open
> > Source
> > +// License. See LICENSE.TXT for details.
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +//
> > +// Symbol flags for symbols in the JIT (e.g. weak, exported).
> > +//
> >
> +//===----------------------------------------------------------------------===//
> > +
> > +#ifndef LLVM_EXECUTIONENGINE_JITSYMBOLFLAGS_H
> > +#define LLVM_EXECUTIONENGINE_JITSYMBOLFLAGS_H
> > +
> > +#include "llvm/IR/GlobalValue.h"
> > +
> > +namespace llvm {
> > +
> > +/// @brief Flags for symbols in the JIT.
> > +enum class JITSymbolFlags : char {
> > + None = 0,
> > + Weak = 1U << 0,
> > + Exported = 1U << 1
> > +};
> > +
> > +JITSymbolFlags operator|(JITSymbolFlags LHS, JITSymbolFlags RHS) {
> > + typedef std::underlying_type<JITSymbolFlags>::type UT;
> > + return static_cast<JITSymbolFlags>(
> > + static_cast<UT>(LHS) | static_cast<UT>(RHS));
> > +}
>
> This does not link when compiled with gcc 4.8.0:
>
> multiple definition of `llvm::operator|(llvm::JITSymbolFlags,
> llvm::JITSymbolFlags)'
>
> -Hal
>
> > +
> > +JITSymbolFlags& operator |=(JITSymbolFlags &LHS, JITSymbolFlags RHS)
> > {
> > + LHS = LHS | RHS;
> > + return LHS;
> > +}
> > +
> > +JITSymbolFlags operator&(JITSymbolFlags LHS, JITSymbolFlags RHS) {
> > + typedef std::underlying_type<JITSymbolFlags>::type UT;
> > + return static_cast<JITSymbolFlags>(
> > + static_cast<UT>(LHS) & static_cast<UT>(RHS));
> > +}
> > +
> > +JITSymbolFlags& operator &=(JITSymbolFlags &LHS, JITSymbolFlags RHS)
> > {
> > + LHS = LHS & RHS;
> > + return LHS;
> > +}
> > +
> > +/// @brief Base class for symbols in the JIT.
> > +class JITSymbolBase {
> > +public:
> > + JITSymbolBase(JITSymbolFlags Flags) : Flags(Flags) {}
> > +
> > + JITSymbolFlags getFlags() const { return Flags; }
> > +
> > + bool isWeak() const {
> > + return (Flags & JITSymbolFlags::Weak) == JITSymbolFlags::Weak;
> > + }
> > +
> > + bool isExported() const {
> > + return (Flags & JITSymbolFlags::Exported) ==
> > JITSymbolFlags::Exported;
> > + }
> > +
> > + static JITSymbolFlags flagsFromGlobalValue(const GlobalValue &GV)
> > {
> > + JITSymbolFlags Flags = JITSymbolFlags::None;
> > + if (GV.hasWeakLinkage())
> > + Flags |= JITSymbolFlags::Weak;
> > + if (!GV.hasLocalLinkage() && !GV.hasHiddenVisibility())
> > + Flags |= JITSymbolFlags::Exported;
> > + return Flags;
> > +
> > + }
> > +
> > +private:
> > + JITSymbolFlags Flags;
> > +};
> > +
> > +} // end namespace llvm
> > +
> > +#endif
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150311/d1105dcf/attachment.html>
More information about the llvm-commits
mailing list