@@ -29,7 +29,7 @@ static std::string getPackageFullName(const Record *R, StringRef Sep = ".");
2929static std::string getParentPackageFullName (const Record *R,
3030 StringRef Sep = " ." ) {
3131 std::string name;
32- if (DefInit *DI = dyn_cast<DefInit>(R->getValueInit (" ParentPackage" )))
32+ if (const DefInit *DI = dyn_cast<DefInit>(R->getValueInit (" ParentPackage" )))
3333 name = getPackageFullName (DI->getDef (), Sep);
3434 return name;
3535}
@@ -53,7 +53,7 @@ static std::string getCheckerFullName(const Record *R, StringRef Sep = ".") {
5353}
5454
5555static std::string getStringValue (const Record &R, StringRef field) {
56- if (StringInit *SI = dyn_cast<StringInit>(R.getValueInit (field)))
56+ if (const StringInit *SI = dyn_cast<StringInit>(R.getValueInit (field)))
5757 return std::string (SI->getValue ());
5858 return std::string ();
5959}
@@ -94,7 +94,7 @@ static std::string getCheckerDocs(const Record &R) {
9494// / the class itself has to be modified for adding a new option type in
9595// / CheckerBase.td.
9696static std::string getCheckerOptionType (const Record &R) {
97- if (BitsInit *BI = R.getValueAsBitsInit (" Type" )) {
97+ if (const BitsInit *BI = R.getValueAsBitsInit (" Type" )) {
9898 switch (getValueFromBitsInit (BI, R)) {
9999 case 0 :
100100 return " int" ;
@@ -111,7 +111,7 @@ static std::string getCheckerOptionType(const Record &R) {
111111}
112112
113113static std::string getDevelopmentStage (const Record &R) {
114- if (BitsInit *BI = R.getValueAsBitsInit (" DevelopmentStage" )) {
114+ if (const BitsInit *BI = R.getValueAsBitsInit (" DevelopmentStage" )) {
115115 switch (getValueFromBitsInit (BI, R)) {
116116 case 0 :
117117 return " alpha" ;
@@ -131,7 +131,7 @@ static bool isHidden(const Record *R) {
131131 return true ;
132132
133133 // Not declared as hidden, check the parent package if it is hidden.
134- if (DefInit *DI = dyn_cast<DefInit>(R->getValueInit (" ParentPackage" )))
134+ if (const DefInit *DI = dyn_cast<DefInit>(R->getValueInit (" ParentPackage" )))
135135 return isHidden (DI->getDef ());
136136
137137 return false ;
0 commit comments