summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/var.rs14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/ir/var.rs b/src/ir/var.rs
index cd179370..396b3e04 100644
--- a/src/ir/var.rs
+++ b/src/ir/var.rs
@@ -391,25 +391,13 @@ fn parse_macro(
) -> Option<(Vec<u8>, cexpr::expr::EvalResult)> {
use cexpr::expr;
- let mut cexpr_tokens: Vec<_> = tokens
+ let cexpr_tokens: Vec<_> = tokens
.iter()
.filter_map(ClangToken::as_cexpr_token)
.collect();
let parser = expr::IdentifierParser::new(ctx.parsed_macros());
- if let Ok((_, (id, val))) = parser.macro_definition(&cexpr_tokens) {
- return Some((id.into(), val));
- }
-
- // Try without the last token, to workaround a libclang bug in versions
- // previous to 4.0.
- //
- // See:
- // https://bugs.llvm.org//show_bug.cgi?id=9069
- // https://reviews.llvm.org/D26446
- cexpr_tokens.pop()?;
-
match parser.macro_definition(&cexpr_tokens) {
Ok((_, (id, val))) => Some((id.into(), val)),
_ => None,