summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-08-16 18:34:31 +0000
committerMatt Fleming <matt@console-pimps.org>2010-08-16 18:34:31 +0000
commitc6beca522cac1d512eb2ef474f081fb9cbe3bf17 (patch)
treed024a730aeffc99a3d43a6a19576cd1ee76ec2c4 /llvm
parent037292df7d522ea2c6d92907bbf76428fd8b4180 (diff)
downloadbcm5719-llvm-c6beca522cac1d512eb2ef474f081fb9cbe3bf17.tar.gz
bcm5719-llvm-c6beca522cac1d512eb2ef474f081fb9cbe3bf17.zip
Record a symbol's size which is needed for ELF symbol tables.
llvm-svn: 111170
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/MC/MCAssembler.h14
-rw-r--r--llvm/lib/MC/MCAssembler.cpp3
2 files changed, 16 insertions, 1 deletions
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 50cb73bd273..e72011f0467 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -24,6 +24,7 @@ namespace llvm {
class raw_ostream;
class MCAsmLayout;
class MCAssembler;
+class MCBinaryExpr;
class MCContext;
class MCCodeEmitter;
class MCExpr;
@@ -453,6 +454,10 @@ public:
// common symbol can never get a definition.
uint64_t CommonSize;
+ /// SymbolSize - An expression describing how to calculate the size of
+ /// a symbol. If a symbol has no size this field will be NULL.
+ const MCExpr *SymbolSize;
+
/// CommonAlign - The alignment of the symbol, if it is 'common'.
//
// FIXME: Pack this in with other fields?
@@ -510,6 +515,15 @@ public:
return CommonSize;
}
+ void setSize(const MCExpr *SS) {
+ SymbolSize = SS;
+ }
+
+ const MCExpr *getSize() const {
+ return SymbolSize;
+ }
+
+
/// getCommonAlignment - Return the alignment of a 'common' symbol.
unsigned getCommonAlignment() const {
assert(isCommon() && "Not a 'common' symbol!");
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 2512a81cf4d..8e255aa4ec4 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -211,7 +211,8 @@ MCSymbolData::MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment,
uint64_t _Offset, MCAssembler *A)
: Symbol(&_Symbol), Fragment(_Fragment), Offset(_Offset),
IsExternal(false), IsPrivateExtern(false),
- CommonSize(0), CommonAlign(0), Flags(0), Index(0)
+ CommonSize(0), SymbolSize(0), CommonAlign(0),
+ Flags(0), Index(0)
{
if (A)
A->getSymbolList().push_back(this);
OpenPOWER on IntegriCloud