Changes in / [8633f060:b03eed6]
- Location:
- src
- Files:
-
- 4 edited
-
Common/SemanticError.h (modified) (3 diffs)
-
Common/utility.h (modified) (2 diffs)
-
Parser/DeclarationNode.cc (modified) (3 diffs)
-
Parser/TypeData.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.h
r8633f060 rb03eed6 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Apr 19 17:52:03 201813 // Update Count : 1 912 // Last Modified On : Tue Aug 29 22:03:36 2017 13 // Update Count : 17 14 14 // 15 15 … … 52 52 {"self-assign" , "self assignment of expression: %s" , Severity::Warn}, 53 53 {"reference-conversion", "rvalue to reference conversion of rvalue: %s", Severity::Warn}, 54 {"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn},55 54 }; 56 55 … … 58 57 SelfAssignment, 59 58 RvalueToReferenceConversion, 60 BadQualifiersZeroOne,61 59 NUMBER_OF_WARNINGS, //This MUST be the last warning 62 60 }; -
src/Common/utility.h
r8633f060 rb03eed6 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Th u Apr 19 16:21:44 201813 // Update Count : 3 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 17 11:38:00 2017 13 // Update Count : 34 14 14 // 15 15 … … 436 436 } 437 437 438 // -----------------------------------------------------------------------------439 // O(1) polymorphic integer log2, using clz, which returns the number of leading 0-bits, starting at the most440 // significant bit (single instruction on x86)441 442 template<typename T>443 inline constexpr T log2(const T & t) {444 if ( std::is_integral<T>::value ) {445 const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1;446 if ( sizeof(T) == sizeof(unsigned int ) ) return r - __builtin_clz( t );447 if ( sizeof(T) == sizeof(unsigned long) ) return r - __builtin_clzl( t );448 if ( sizeof(T) == sizeof(unsigned long long) ) return r - __builtin_clzll( t );449 } // if450 return -1;451 }452 438 453 439 -
src/Parser/DeclarationNode.cc
r8633f060 rb03eed6 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Apr 19 15:09:29201813 // Update Count : 10 6212 // Last Modified On : Thu Feb 22 15:37:17 2018 13 // Update Count : 1033 14 14 // 15 15 … … 47 47 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "trait", "coroutine", "monitor", "thread", "NoAggregateNames" }; 48 48 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", " zero_t", "one_t", "NoBuiltinTypeNames" };49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "NoBuiltinTypeNames" }; 50 50 51 51 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 561 561 562 562 checkQualifiers( type, q->type ); 563 if ( (builtin == Zero || builtin == One) && error.length() == 0 ) {564 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[log2( q->type->qualifiers.val )], builtinTypeNames[builtin] );565 // appendError( error, string( "questionable qualifiers" ) );566 } // if567 563 addQualifiersToType( q->type, type ); 568 564 -
src/Parser/TypeData.cc
r8633f060 rb03eed6 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Apr 17 23:00:52201813 // Update Count : 60212 // Last Modified On : Thu Feb 22 15:49:00 2018 13 // Update Count : 597 14 14 // 15 15 … … 395 395 break; 396 396 case Builtin: 397 os << DeclarationNode::builtinTypeNames[builtintype];397 os << "gcc builtin type"; 398 398 break; 399 399 default:
Note:
See TracChangeset
for help on using the changeset viewer.