diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-04-15 14:24:37 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-04-15 14:24:37 +0000 |
commit | dda56e4b4a9c274c5c4011981bd291523e75d747 (patch) | |
tree | cf196c641b7ddeaba8528f2509fc2242ebc7420f /clang/lib/CodeGen | |
parent | 030f499d2f9b2f17c22aad372cdf391e7db22a4f (diff) | |
download | bcm5719-llvm-dda56e4b4a9c274c5c4011981bd291523e75d747.tar.gz bcm5719-llvm-dda56e4b4a9c274c5c4011981bd291523e75d747.zip |
Support for C++11 (non-template) alias declarations.
llvm-svn: 129567
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 5 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTBAA.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 9b400cbe2aa..d496982b814 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -91,8 +91,9 @@ void CodeGenFunction::EmitDecl(const Decl &D) { return EmitVarDecl(VD); } - case Decl::Typedef: { // typedef int X; - const TypedefDecl &TD = cast<TypedefDecl>(D); + case Decl::Typedef: // typedef int X; + case Decl::TypeAlias: { // using X = int; [C++0x] + const TypedefNameDecl &TD = cast<TypedefNameDecl>(D); QualType Ty = TD.getUnderlyingType(); if (Ty->isVariablyModifiedType()) diff --git a/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp index 3f2c6cabf2a..622b9a5587d 100644 --- a/clang/lib/CodeGen/CodeGenTBAA.cpp +++ b/clang/lib/CodeGen/CodeGenTBAA.cpp @@ -155,7 +155,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { // theoretically implement this by combining information about all the // members into a single identifying MDNode. if (!Features.CPlusPlus && - ETy->getDecl()->getTypedefForAnonDecl()) + ETy->getDecl()->getTypedefNameForAnonDecl()) return MetadataCache[Ty] = getChar(); // In C++ mode, types have linkage, so we can rely on the ODR and diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 13aa23d8d0d..731114bcca9 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -387,7 +387,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { OS << TD->getQualifiedNameAsString(); else TD->printName(OS); - } else if (const TypedefDecl *TDD = TD->getTypedefForAnonDecl()) { + } else if (const TypedefNameDecl *TDD = TD->getTypedefNameForAnonDecl()) { // FIXME: We should not have to check for a null decl context here. // Right now we do it because the implicit Obj-C decls don't have one. if (TDD->getDeclContext()) |