forked from OSchip/llvm-project
parent
be2c6e9734
commit
ef89ae016d
|
@ -331,10 +331,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
|
||||||
|
|
||||||
// Turn "unsigned type" to "utype"
|
// Turn "unsigned type" to "utype"
|
||||||
std::string::size_type pos = typeName.find("unsigned");
|
std::string::size_type pos = typeName.find("unsigned");
|
||||||
if(pos != std::string::npos) {
|
if (pos != std::string::npos)
|
||||||
typeName = typeName.substr(0, pos+1) +
|
typeName.erase(pos+1, 8);
|
||||||
typeName.substr(pos+9, typeName.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
argTypeNames.push_back(llvm::MDString::get(Context, typeName));
|
argTypeNames.push_back(llvm::MDString::get(Context, typeName));
|
||||||
|
|
||||||
|
@ -343,15 +341,9 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
|
||||||
typeQuals = "restrict";
|
typeQuals = "restrict";
|
||||||
if (pointeeTy.isConstQualified() ||
|
if (pointeeTy.isConstQualified() ||
|
||||||
(pointeeTy.getAddressSpace() == LangAS::opencl_constant))
|
(pointeeTy.getAddressSpace() == LangAS::opencl_constant))
|
||||||
if (typeQuals != "")
|
typeQuals += typeQuals.empty() ? "const" : " const";
|
||||||
typeQuals += " const";
|
|
||||||
else
|
|
||||||
typeQuals += "const";
|
|
||||||
if (pointeeTy.isVolatileQualified())
|
if (pointeeTy.isVolatileQualified())
|
||||||
if (typeQuals != "")
|
typeQuals += typeQuals.empty() ? "volatile" : " volatile";
|
||||||
typeQuals += " volatile";
|
|
||||||
else
|
|
||||||
typeQuals += "volatile";
|
|
||||||
} else {
|
} else {
|
||||||
addressQuals.push_back(Builder.getInt32(0));
|
addressQuals.push_back(Builder.getInt32(0));
|
||||||
|
|
||||||
|
@ -360,10 +352,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
|
||||||
|
|
||||||
// Turn "unsigned type" to "utype"
|
// Turn "unsigned type" to "utype"
|
||||||
std::string::size_type pos = typeName.find("unsigned");
|
std::string::size_type pos = typeName.find("unsigned");
|
||||||
if(pos != std::string::npos) {
|
if (pos != std::string::npos)
|
||||||
typeName = typeName.substr(0, pos+1) +
|
typeName.erase(pos+1, 8);
|
||||||
typeName.substr(pos+9, typeName.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
argTypeNames.push_back(llvm::MDString::get(Context, typeName));
|
argTypeNames.push_back(llvm::MDString::get(Context, typeName));
|
||||||
|
|
||||||
|
@ -371,10 +361,7 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
|
||||||
if (ty.isConstQualified())
|
if (ty.isConstQualified())
|
||||||
typeQuals = "const";
|
typeQuals = "const";
|
||||||
if (ty.isVolatileQualified())
|
if (ty.isVolatileQualified())
|
||||||
if (typeQuals != "")
|
typeQuals += typeQuals.empty() ? "volatile" : " volatile";
|
||||||
typeQuals += " volatile";
|
|
||||||
else
|
|
||||||
typeQuals += "volatile";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
argTypeQuals.push_back(llvm::MDString::get(Context, typeQuals));
|
argTypeQuals.push_back(llvm::MDString::get(Context, typeQuals));
|
||||||
|
|
Loading…
Reference in New Issue