summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-06-24 17:51:48 +0000
committerReid Kleckner <reid@kleckner.net>2013-06-24 17:51:48 +0000
commit8a36502a60326473ec187eaa954e47beab25a8fb (patch)
tree870e495d25ecd31f373f025e3e21a1adee894187 /clang/lib/CodeGen/CodeGenFunction.cpp
parent52dd02d8ef35221568f9afd79f4b4f7b7f7bfda5 (diff)
downloadbcm5719-llvm-8a36502a60326473ec187eaa954e47beab25a8fb.tar.gz
bcm5719-llvm-8a36502a60326473ec187eaa954e47beab25a8fb.zip
[AST] Introduce a new DecayedType sugar node
The goal of this sugar node is to be able to look at an arbitrary FunctionType and tell if any of the parameters were decayed from an array or function type. Ultimately this is necessary to implement Microsoft's C++ name mangling scheme, which mangles decayed arrays differently from normal pointers. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1014 llvm-svn: 184763
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 297fc655e44..c6b498cd586 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1273,6 +1273,10 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) {
case Type::ObjCObjectPointer:
llvm_unreachable("type class is never variably-modified!");
+ case Type::Decayed:
+ type = cast<DecayedType>(ty)->getPointeeType();
+ break;
+
case Type::Pointer:
type = cast<PointerType>(ty)->getPointeeType();
break;
OpenPOWER on IntegriCloud