Bug 97020 - Implicit C Types should use new CBasicType constructor
Summary: Implicit C Types should use new CBasicType constructor
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Devin Steffler CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-05-27 11:54 EDT by Andrew Niefer CLA
Modified: 2008-06-19 12:58 EDT (History)
2 users (show)

See Also:


Attachments
patch for PR 92020 (95.12 KB, patch)
2005-05-30 16:28 EDT, Devin Steffler 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 Andrew Niefer CLA 2005-05-27 11:54:15 EDT
CBasicType now has a CBasicType( int type, int qualifiers ) constructors (like
the CPPBasicType has).

This means GCCBuiltinSymbolProvider doesn't need to create
ICASTSimpleDeclSpecifier objects anymore, it can create the basic types directly.
Comment 1 Devin Steffler CLA 2005-05-27 11:57:30 EDT
The types in GCCBuiltinSymbolProvider should also be created only once.  I had 
a patch for this but lost it somewhere in the madness when John was gone for a 
couple of days.  I'll redo this as part of a fix for this PR.
Comment 2 Devin Steffler CLA 2005-05-27 15:07:48 EDT
Patch sent to cdt-patch@eclipse.org
Comment 3 Devin Steffler CLA 2005-05-30 16:28:46 EDT
Created attachment 21992 [details]
patch for PR 92020

GCCBuiltinSymbolProvider now creates basic types directly, and only once.  This
means that GCCBuiltinSymbolProvider is much cleaner than it was before and as
such is much easier to maintain.
Comment 4 John Camelon CLA 2005-06-01 09:03:56 EDT
Andrew can you look at/apply this patch?
Comment 5 Andrew Niefer CLA 2005-06-01 14:40:33 EDT
patch applied with modifications:
- changed type fields to static final and used a static initializer 
- changed types to refer to each other  ie cpp_void_p = new CPPPointer( cpp_void );
- long is semantically the same as long int, removed the duplicate.
- bits fields are combined with | not & (ie CBasicType.IS_LONG |
CBasicType.IS_UNSIGNED)