From 4bb331ad4f8e8925cdde1efd1205ec511536ceed Mon Sep 17 00:00:00 2001 From: Rohan Jacob-Rao Date: Mon, 10 Aug 2015 17:58:47 -0700 Subject: [PATCH] Parse and ignore function declarations. --- infer/src/llvm/lLexer.mll | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/infer/src/llvm/lLexer.mll b/infer/src/llvm/lLexer.mll index 6aeacefba..8b8509144 100644 --- a/infer/src/llvm/lLexer.mll +++ b/infer/src/llvm/lLexer.mll @@ -29,8 +29,10 @@ let id_special_char = ['-' '$' '.' '_'] let id_char = lower | upper | id_special_char let id = id_char (id_char | digit)* -(* definition of attribute group - not used for now *) -let attribute_junk = "attributes" [^ '\n']* +(* some top level constructs currently ignored *) +let declaration = "declare " [^ '\n']* +let attribute_group = "attributes " [^ '\n']* + let string_content = [^ '"']* rule token = parse @@ -172,8 +174,10 @@ rule token = parse | '!' '"' ([^ '"']* as str) '"' { METADATA_STRING str } | "!{" { METADATA_NODE_BEGIN } + | declaration { token lexbuf } + (* attribute groups *) | '#' (nonneg_int as i) { ATTRIBUTE_GROUP (int_of_string i) } - | attribute_junk { token lexbuf } + | attribute_group { token lexbuf } | eof { EOF }