Bug 145389 - CDT parser has problems with assembly code
Summary: CDT parser has problems with assembly code
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 5.0   Edit
Assignee: Markus Schorn CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-06-05 13:23 EDT by David Daoust CLA
Modified: 2008-06-22 02:46 EDT (History)
1 user (show)

See Also:


Attachments
Patch to support GNU Extended ASM (4.13 KB, patch)
2007-06-07 06:36 EDT, Richard Miskin CLA
no flags Details | Diff
Patch to support GNU Extended ASM (4.85 KB, patch)
2007-06-07 09:27 EDT, Richard Miskin CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Daoust CLA 2006-06-05 13:23:22 EDT
#define mb()  __asm__ __volatile__ ("sync" : : : "memory")

int main(int argc, char **argv) {
	mb();
}
--
This is an example ppc assembly usage -- note that it is syntactically correct, but gcc on windows will complain about the instructions (which are not x86).

This may mask other errors -- but the parser seems to recover ok.
Comment 1 Richard Miskin CLA 2007-06-07 06:36:43 EDT
Created attachment 70482 [details]
Patch to support GNU Extended ASM

This patch updates the AbstractGNUSourceCodeParser to accept the GNU asm extensions and adds a test in CompleteParser2Tests.

I'm not storing any of the additional information so for the example above you couldn't tell that the declaration is volatile and only "sync" returned by getAssembly.
Comment 2 Richard Miskin CLA 2007-06-07 09:27:46 EDT
Created attachment 70496 [details]
Patch to support GNU Extended ASM

Further updates to support code in bug 117001 and also support named operands.
Comment 3 Markus Schorn CLA 2008-04-16 12:29:32 EDT
Thanks, I have added your testcase, it passses.
Comment 4 Doug Schaefer CLA 2008-06-03 15:11:33 EDT
assigning
Comment 5 Doug Schaefer CLA 2008-06-03 15:11:51 EDT
done