Id's fo Expr-inherited classes
This commit is contained in:
10
module.cpp
10
module.cpp
@@ -608,7 +608,7 @@ Module::AddGlobalVariable(const std::string &name, const Type *type, Expr *initE
|
||||
// the same type as the global. (But not if it's an
|
||||
// ExprList; they don't have types per se / can't type
|
||||
// convert themselves anyway.)
|
||||
if (dynamic_cast<ExprList *>(initExpr) == NULL)
|
||||
if (llvm::dyn_cast<ExprList>(initExpr) == NULL)
|
||||
initExpr = TypeConvertExpr(initExpr, type, "initializer");
|
||||
|
||||
if (initExpr != NULL) {
|
||||
@@ -620,11 +620,11 @@ Module::AddGlobalVariable(const std::string &name, const Type *type, Expr *initE
|
||||
if (llvmInitializer != NULL) {
|
||||
if (type->IsConstType())
|
||||
// Try to get a ConstExpr associated with
|
||||
// the symbol. This dynamic_cast can
|
||||
// the symbol. This llvm::dyn_cast can
|
||||
// validly fail, for example for types like
|
||||
// StructTypes where a ConstExpr can't
|
||||
// represent their values.
|
||||
constValue = dynamic_cast<ConstExpr *>(initExpr);
|
||||
constValue = llvm::dyn_cast<ConstExpr>(initExpr);
|
||||
}
|
||||
else
|
||||
Error(initExpr->pos, "Initializer for global variable \"%s\" "
|
||||
@@ -1906,7 +1906,7 @@ std::string emitOffloadParamStruct(const std::string ¶mStructName,
|
||||
Error(sym->pos,"When emitting offload-stubs, \"export\"ed functions cannot have non-const reference-type parameters.\n");
|
||||
}
|
||||
const ReferenceType *refType
|
||||
= dynamic_cast<const ReferenceType*>(orgParamType);
|
||||
= llvm::dyn_cast<const ReferenceType>(orgParamType);
|
||||
paramType = refType->GetReferenceTarget()->GetAsNonConstType();
|
||||
} else {
|
||||
paramType = orgParamType->GetAsNonConstType();
|
||||
@@ -2025,7 +2025,7 @@ Module::writeDevStub(const char *fn)
|
||||
Error(sym->pos,"When emitting offload-stubs, \"export\"ed functions cannot have non-const reference-type parameters.\n");
|
||||
}
|
||||
const ReferenceType *refType
|
||||
= dynamic_cast<const ReferenceType*>(orgParamType);
|
||||
= llvm::dyn_cast<const ReferenceType>(orgParamType);
|
||||
paramType = refType->GetReferenceTarget()->GetAsNonConstType();
|
||||
} else {
|
||||
paramType = orgParamType->GetAsNonConstType();
|
||||
|
||||
Reference in New Issue
Block a user