diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-10-16 01:20:40 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-10-16 01:20:40 +0000 |
commit | d34cf143391c33d799ccd4735d3fe7630cdaa44b (patch) | |
tree | dab1ad6daeb50f9cec7f8a64c16e1d81f570200a /llvm/lib/MC/MCSymbol.cpp | |
parent | 5645bade1bcde40a768b7daa43d8e0878243aae1 (diff) | |
download | bcm5719-llvm-d34cf143391c33d799ccd4735d3fe7630cdaa44b.tar.gz bcm5719-llvm-d34cf143391c33d799ccd4735d3fe7630cdaa44b.zip |
MC: Better handling of tricky symbol and section names
Because of win32 mangling, we produce symbol and section names with
funny characters in them, most notably @ characters.
MC would choke on trying to parse its own assembly output. This patch addresses
that by:
- Making @ trigger quoting of symbol names
- Also quote section names in the same way
- Just parse section names like other identifiers (to allow for quotes)
- Don't assume @ signifies a symbol variant if it is in a string.
Differential Revision: http://llvm-reviews.chandlerc.com/D1945
llvm-svn: 192758
Diffstat (limited to 'llvm/lib/MC/MCSymbol.cpp')
-rw-r--r-- | llvm/lib/MC/MCSymbol.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp index b973c57f7b8..f386c3bc90a 100644 --- a/llvm/lib/MC/MCSymbol.cpp +++ b/llvm/lib/MC/MCSymbol.cpp @@ -18,12 +18,10 @@ const MCSection *MCSymbol::AbsolutePseudoSection = reinterpret_cast<const MCSection *>(1); static bool isAcceptableChar(char C) { - if ((C < 'a' || C > 'z') && - (C < 'A' || C > 'Z') && - (C < '0' || C > '9') && - C != '_' && C != '$' && C != '.' && C != '@') - return false; - return true; + return (C >= 'a' && C <= 'z') || + (C >= 'A' && C <= 'Z') || + (C >= '0' && C <= '9') || + C == '_' || C == '$' || C == '.'; } /// NameNeedsQuoting - Return true if the identifier \p Str needs quotes to be |