[spirv] use std::ostringstream to build string.

This commit is contained in:
Ehsan Nasiri 2018-12-17 15:07:29 -05:00 коммит произвёл Ehsan
Родитель 825156fd15
Коммит 59d6973a84
3 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -297,10 +297,8 @@ const SpirvType *LowerTypeVisitor::lowerType(QualType type,
// LowerTypeVisitor is invoked. We should error out if we encounter a
// literal type.
case BuiltinType::LitInt:
// emitError("found literal int type when lowering types", srcLoc);
return spvContext.getUIntType(64);
case BuiltinType::LitFloat: {
// emitError("found literal float type when lowering types", srcLoc);
return spvContext.getFloatType(64);
default:

Просмотреть файл

@ -1,4 +1,4 @@
//===------- SpirvEmitter.h - SPIR-V Binary Code Emitter --------*- C++ -*-===//
//===------- SpirvEmitter.cpp - SPIR-V Binary Code Emitter ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//

Просмотреть файл

@ -12,6 +12,8 @@
#include "clang/SPIRV/SpirvType.h"
#include <sstream>
namespace clang {
namespace spirv {
@ -167,9 +169,9 @@ std::string ImageType::getImageName(spv::Dim dim, bool arrayed) {
default:
break;
}
std::string name =
std::string("type.") + dimStr + "image" + (arrayed ? ".array" : "");
return name;
std::ostringstream name;
name << "type." << dimStr << "image" << (arrayed ? ".array" : "");
return name.str();
}
bool ImageType::operator==(const ImageType &that) const {