瀏覽代碼

[spirv] Remove LiteralTypeHint for APValues.

Ehsan Nasiri 6 年之前
父節點
當前提交
161c04d33c
共有 1 個文件被更改,包括 0 次插入6 次删除
  1. 0 6
      tools/clang/lib/SPIRV/SPIRVEmitter.cpp

+ 0 - 6
tools/clang/lib/SPIRV/SPIRVEmitter.cpp

@@ -8712,10 +8712,6 @@ SpirvConstant *SPIRVEmitter::translateAPValue(const APValue &value,
                                               const QualType targetType) {
                                               const QualType targetType) {
   SpirvConstant *result = nullptr;
   SpirvConstant *result = nullptr;
 
 
-  // Provide a hint to the typeTranslator that if a literal is discovered, its
-  // intended usage is targetType.
-  TypeTranslator::LiteralTypeHint hint(typeTranslator, targetType);
-
   if (targetType->isBooleanType()) {
   if (targetType->isBooleanType()) {
     result = spvBuilder.getConstantBool(value.getInt().getBoolValue(),
     result = spvBuilder.getConstantBool(value.getInt().getBoolValue(),
                                         isSpecConstantMode);
                                         isSpecConstantMode);
@@ -8749,7 +8745,6 @@ SpirvConstant *SPIRVEmitter::translateAPValue(const APValue &value,
 
 
 SpirvConstant *SPIRVEmitter::translateAPInt(const llvm::APInt &intValue,
 SpirvConstant *SPIRVEmitter::translateAPInt(const llvm::APInt &intValue,
                                             QualType targetType) {
                                             QualType targetType) {
-  targetType = typeTranslator.getIntendedLiteralType(targetType);
   return spvBuilder.getConstantInt(targetType, intValue, isSpecConstantMode);
   return spvBuilder.getConstantInt(targetType, intValue, isSpecConstantMode);
 }
 }
 
 
@@ -8822,7 +8817,6 @@ SPIRVEmitter::tryToEvaluateAsFloat32(const llvm::APFloat &floatValue) {
 
 
 SpirvConstant *SPIRVEmitter::translateAPFloat(llvm::APFloat floatValue,
 SpirvConstant *SPIRVEmitter::translateAPFloat(llvm::APFloat floatValue,
                                               QualType targetType) {
                                               QualType targetType) {
-  targetType = typeTranslator.getIntendedLiteralType(targetType);
   return spvBuilder.getConstantFloat(targetType, floatValue,
   return spvBuilder.getConstantFloat(targetType, floatValue,
                                      isSpecConstantMode);
                                      isSpecConstantMode);
 }
 }