bool EH = false;
bool Debug = false;
- if (parseIdentifier(Name))
- return TokError("Expected an identifier");
-
- if (Name == ".eh_frame")
- EH = true;
- else if (Name == ".debug_frame")
- Debug = true;
-
- if (getLexer().is(AsmToken::Comma)) {
- Lex();
-
- if (parseIdentifier(Name))
- return TokError("Expected an identifier");
-
- if (Name == ".eh_frame")
- EH = true;
- else if (Name == ".debug_frame")
- Debug = true;
+ if (!parseOptionalToken(AsmToken::EndOfStatement)) {
+ for (;;) {
+ if (parseIdentifier(Name))
+ return TokError("expected .eh_frame or .debug_frame");
+ if (Name == ".eh_frame")
+ EH = true;
+ else if (Name == ".debug_frame")
+ Debug = true;
+ if (parseOptionalToken(AsmToken::EndOfStatement))
+ break;
+ if (parseToken(AsmToken::Comma))
+ return true;
+ }
}
-
- if (parseToken(AsmToken::EndOfStatement))
- return addErrorSuffix(" in '.cfi_sections' directive");
-
getStreamer().emitCFISections(EH, Debug);
return false;
}
TS->emitLabel(Symbol);
}
-void MCStreamer::emitCFISections(bool EH, bool Debug) {
- assert(EH || Debug);
-}
+void MCStreamer::emitCFISections(bool EH, bool Debug) {}
void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) {
if (hasUnfinishedDwarfFrameInfo())
--- /dev/null
+# RUN: llvm-mc -filetype=obj -triple x86_64 %s | llvm-readelf -S - | FileCheck %s
+
+# CHECK: Section Headers:
+# CHECK-NOT: .eh_frame
+# CHECK-NOT: .debug_frame
+
+.cfi_sections
+
+## .cfi_startproc and .cfi_endproc are ignored.
+.cfi_startproc
+nop
+.cfi_endproc
// CHECK: }
.ifdef ERR
-// ERR: [[#@LINE+1]]:15: error: Expected an identifier
+// ERR: [[#@LINE+1]]:15: error: expected .eh_frame or .debug_frame
.cfi_sections $
-// ERR: [[#@LINE+1]]:28: error: unexpected token in '.cfi_sections' directive
+// ERR: [[#@LINE+1]]:28: error: unexpected token
.cfi_sections .debug_frame $
-// ERR: [[#@LINE+1]]:39: error: unexpected token in '.cfi_sections' directive
+// ERR: [[#@LINE+1]]:39: error: unexpected token
.cfi_sections .debug_frame, .eh_frame $
// ERR: [[#@LINE+1]]:16: error: unexpected token in '.cfi_startproc' directive