llvm-mc: Diagnose misuse (mix) of defined symbols and labels.
[oota-llvm.git] / include / llvm / MC / MCSymbol.h
1 //===- MCSymbol.h - Machine Code Symbols ------------------------*- C++ -*-===//
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 #ifndef LLVM_MC_MCSYMBOL_H
11 #define LLVM_MC_MCSYMBOL_H
12
13 #include <string>
14
15 namespace llvm {
16   class MCSymbol {
17     MCSection *Section;
18     std::string Name;
19     unsigned IsTemporary : 1;
20     unsigned IsExternal : 1;
21
22   public:
23     MCSymbol(const char *_Name, bool _IsTemporary) 
24       : Section(0), Name(_Name), IsTemporary(_IsTemporary), IsExternal(false) {}
25
26     MCSection *getSection() const { return Section; }
27     void setSection(MCSection *Value) { Section = Value; }
28
29     bool isExternal() const { return IsExternal; }
30     void setExternal(bool Value) { IsExternal = Value; }
31
32     const std::string &getName() const { return Name; }
33   };
34
35 } // end namespace llvm
36
37 #endif