summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2019-02-08 00:51:05 +0000
committerJF Bastien <jfbastien@apple.com>2019-02-08 00:51:05 +0000
commitddeb2f2a160595159b1e330385aaf51f5b2f3e51 (patch)
treeb1b0b1f91b6e95e9c0b9e06eba591468a53ecb42 /clang/lib/CodeGen/CGDecl.cpp
parentc782f188356426e2dce848d41d4155687adefac2 (diff)
downloadbcm5719-llvm-ddeb2f2a160595159b1e330385aaf51f5b2f3e51.tar.gz
bcm5719-llvm-ddeb2f2a160595159b1e330385aaf51f5b2f3e51.zip
[NFC] Variable auto-init: use getAsVariableArrayType helper
As suggested by @rjmccall in D57797. llvm-svn: 353490
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 25103441ac1..f91fb010a79 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1658,8 +1658,7 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
// Technically zero-sized or negative-sized VLAs are undefined, and UBSan
// will catch that code, but there exists code which generates zero-sized
// VLAs. Be nice and initialize whatever they requested.
- const VariableArrayType *VlaType =
- dyn_cast_or_null<VariableArrayType>(getContext().getAsArrayType(type));
+ const auto *VlaType = getContext().getAsVariableArrayType(type);
if (!VlaType)
return;
auto VlaSize = getVLASize(VlaType);
OpenPOWER on IntegriCloud