aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-09-18 16:57:42 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-09-18 16:57:42 +0000
commitc6f729ed5519cdf398ca4039dbdbea4f81433ec0 (patch)
tree869948d5bfd5d30bb4d55c7ee8a7a82b23d650f2 /include
parent7de3bd273ec3f4f027089285106095e8700e226d (diff)
downloadexternal_llvm-c6f729ed5519cdf398ca4039dbdbea4f81433ec0.zip
external_llvm-c6f729ed5519cdf398ca4039dbdbea4f81433ec0.tar.gz
external_llvm-c6f729ed5519cdf398ca4039dbdbea4f81433ec0.tar.bz2
Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430. This unbreaks PR4776. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAsmInfo.h7
-rw-r--r--include/llvm/Support/Mangler.h10
2 files changed, 16 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 98e43a3..fb69630 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -95,6 +95,10 @@ namespace llvm {
/// AllowQuotesInName - This is true if the assembler allows for complex
/// symbol names to be surrounded in quotes. This defaults to false.
bool AllowQuotesInName;
+
+ /// AllowNameToStartWithDigit - This is true if the assembler allows symbol
+ /// names to start with a digit (e.g., "0x0021"). This defaults to false.
+ bool AllowNameToStartWithDigit;
//===--- Data Emission Directives -------------------------------------===//
@@ -354,6 +358,9 @@ namespace llvm {
bool doesAllowQuotesInName() const {
return AllowQuotesInName;
}
+ bool doesAllowNameToStartWithDigit() const {
+ return AllowNameToStartWithDigit;
+ }
const char *getZeroDirective() const {
return ZeroDirective;
}
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h
index 23ea377..03c5648 100644
--- a/include/llvm/Support/Mangler.h
+++ b/include/llvm/Support/Mangler.h
@@ -51,6 +51,10 @@ private:
/// the space character. By default, this is false.
bool UseQuotes;
+ /// SymbolsCanStartWithDigit - If this is set, the target allows symbols to
+ /// start with digits (e.g., "0x0021"). By default, this is false.
+ bool SymbolsCanStartWithDigit;
+
/// AnonGlobalIDs - We need to give global values the same name every time
/// they are mangled. This keeps track of the number we give to anonymous
/// ones.
@@ -75,9 +79,13 @@ public:
/// strings for assembler labels.
void setUseQuotes(bool Val) { UseQuotes = Val; }
+ /// setSymbolsCanStartWithDigit - If SymbolsCanStartWithDigit is set to true,
+ /// this target allows symbols to start with digits.
+ void setSymbolsCanStartWithDigit(bool Val) { SymbolsCanStartWithDigit = Val; }
+
/// Acceptable Characters - This allows the target to specify which characters
/// are acceptable to the assembler without being mangled. By default we
- /// allow letters, numbers, '_', '$', and '.', which is what GAS accepts.
+ /// allow letters, numbers, '_', '$', '.', which is what GAS accepts, and '@'.
void markCharAcceptable(unsigned char X) {
AcceptableChars[X/32] |= 1 << (X&31);
}