git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216797
91177308-0d34-0410-b5e6-
96231b3b80d8
return StringRef(".loh");
}
return StringRef(".loh");
}
-static inline bool isValidMCLOHType(MCLOHType Kind) {
+static inline bool isValidMCLOHType(unsigned Kind) {
return Kind >= MCLOH_AdrpAdrp && Kind <= MCLOH_AdrpLdrGot;
}
return Kind >= MCLOH_AdrpAdrp && Kind <= MCLOH_AdrpLdrGot;
}
// We successfully get a numeric value for the identifier.
// Check if it is valid.
int64_t Id = getParser().getTok().getIntVal();
// We successfully get a numeric value for the identifier.
// Check if it is valid.
int64_t Id = getParser().getTok().getIntVal();
- Kind = (MCLOHType)Id;
- // Check that Id does not overflow MCLOHType.
- if (!isValidMCLOHType(Kind) || Id != Kind)
+ if (Id <= -1U && !isValidMCLOHType(Id))
return TokError("invalid numeric identifier in directive");
return TokError("invalid numeric identifier in directive");
} else {
StringRef Name = getTok().getIdentifier();
// We successfully parse an identifier.
} else {
StringRef Name = getTok().getIdentifier();
// We successfully parse an identifier.