LLVM  6.0.0svn
JITSymbol.cpp
Go to the documentation of this file.
1 //===----------- JITSymbol.cpp - JITSymbol class implementation -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // JITSymbol class implementation plus helper functions.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/IR/GlobalValue.h"
17 
18 using namespace llvm;
19 
22  if (GV.hasWeakLinkage() || GV.hasLinkOnceLinkage())
23  Flags |= JITSymbolFlags::Weak;
24  if (GV.hasCommonLinkage())
25  Flags |= JITSymbolFlags::Common;
26  if (!GV.hasLocalLinkage() && !GV.hasHiddenVisibility())
27  Flags |= JITSymbolFlags::Exported;
28  return Flags;
29 }
30 
35  Flags |= JITSymbolFlags::Weak;
37  Flags |= JITSymbolFlags::Common;
39  Flags |= JITSymbolFlags::Exported;
40  return Flags;
41 }
42 
45  ARMJITSymbolFlags Flags;
47  Flags |= ARMJITSymbolFlags::Thumb;
48  return Flags;
49 }
bool hasLocalLinkage() const
Definition: GlobalValue.h:427
static JITSymbolFlags fromGlobalValue(const GlobalValue &GV)
Construct a JITSymbolFlags value based on the flags of the given global value.
Definition: JITSymbol.cpp:20
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool hasCommonLinkage() const
Definition: GlobalValue.h:431
bool hasLinkOnceLinkage() const
Definition: GlobalValue.h:417
Flags for symbols in the JIT.
Definition: JITSymbol.h:40
static JITSymbolFlags fromObjectSymbol(const object::BasicSymbolRef &Symbol)
Construct a JITSymbolFlags value based on the flags of the given libobject symbol.
Definition: JITSymbol.cpp:32
bool hasWeakLinkage() const
Definition: GlobalValue.h:421
bool hasHiddenVisibility() const
Definition: GlobalValue.h:227
uint32_t getFlags() const
Get symbol flags (bitwise OR of SymbolRef::Flags)
Definition: SymbolicFile.h:201
This is a value type class that represents a single symbol in the list of symbols in the object file...
Definition: SymbolicFile.h:99
ARM-specific JIT symbol flags.
Definition: JITSymbol.h:117
static ARMJITSymbolFlags fromObjectSymbol(const object::BasicSymbolRef &Symbol)
Definition: JITSymbol.cpp:43