aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-04-15 14:24:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-04-15 14:24:37 +0000
commit162e1c1b487352434552147967c3dd296ebee2f7 (patch)
tree997de42e97482fd054626d9433d6bf766f93b738 /lib/CodeGen
parent98a57868d696cb5faf6195a609ad084a711c6bbe (diff)
Support for C++11 (non-template) alias declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGDecl.cpp5
-rw-r--r--lib/CodeGen/CodeGenTBAA.cpp2
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 9b400cbe2a..d496982b81 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/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/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp
index 3f2c6cabf2..622b9a5587 100644
--- a/lib/CodeGen/CodeGenTBAA.cpp
+++ b/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/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 13aa23d8d0..731114bcca 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/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())