summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-10-18 02:14:40 +0000
committerHans Wennborg <hans@hanshq.net>2013-10-18 02:14:40 +0000
commit7ddcdc82a59e28f011fc6be6f47de948fe8f6abb (patch)
treefebdfaf4b6126826fcef7b828fe212cfdde800c3 /llvm/lib/MC/MCParser/AsmParser.cpp
parentb6c825a5cf92ca352826552d47e6d82c71eaa7f1 (diff)
downloadbcm5719-llvm-7ddcdc82a59e28f011fc6be6f47de948fe8f6abb.tar.gz
bcm5719-llvm-7ddcdc82a59e28f011fc6be6f47de948fe8f6abb.zip
Revert "Re-commit r192758 - MC: quote tricky symbol names in asm output"
This caused the clang-native-mingw32-win7 buildbot to break. The assembler was complaining about the following lines that were showing up in the asm for CrashRecoveryContext.cpp: movl $"__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4", 4(%eax) calll "_AddVectoredExceptionHandler@8" .def "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"; "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4": calll "_RemoveVectoredExceptionHandler@4" Reverting for now. llvm-svn: 192940
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 75f5c78b70b..9a362563a7e 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -792,25 +792,19 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
EndLoc = SMLoc::getFromPointer(Identifier.end());
// This is a symbol reference.
- StringRef SymbolName = Identifier;
- MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
std::pair<StringRef, StringRef> Split = Identifier.split('@');
+ MCSymbol *Sym = getContext().GetOrCreateSymbol(Split.first);
- if (Split.first.size() != Identifier.size() &&
- FirstTokenKind != AsmToken::String) {
- SymbolName = Split.first;
- StringRef VariantName = Split.second;
-
- // Lookup the symbol variant.
- Variant = MCSymbolRefExpr::getVariantKindForName(VariantName);
+ // Lookup the symbol variant if used.
+ MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
+ if (Split.first.size() != Identifier.size()) {
+ Variant = MCSymbolRefExpr::getVariantKindForName(Split.second);
if (Variant == MCSymbolRefExpr::VK_Invalid) {
Variant = MCSymbolRefExpr::VK_None;
- return TokError("invalid variant '" + VariantName + "'");
+ return TokError("invalid variant '" + Split.second + "'");
}
}
- MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName);
-
// If this is an absolute variable reference, substitute it now to preserve
// semantics in the face of reassignment.
if (Sym->isVariable() && isa<MCConstantExpr>(Sym->getVariableValue())) {
OpenPOWER on IntegriCloud