diff options
author | Chris Lattner <sabre@nondot.org> | 2011-08-12 18:07:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-08-12 18:07:07 +0000 |
commit | 01becebef303d13e9dd44ba85de1d4c4c8708f37 (patch) | |
tree | 24959abe43afe77b6e2e8b1286e8229e2f41bb66 /llvm/lib | |
parent | 335d399a0ebaad60b788124180f850c25326576f (diff) | |
download | llvm-01becebef303d13e9dd44ba85de1d4c4c8708f37.zip llvm-01becebef303d13e9dd44ba85de1d4c4c8708f37.tar.gz llvm-01becebef303d13e9dd44ba85de1d4c4c8708f37.tar.bz2 |
switch to the new struct apis.
llvm-svn: 137481
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/CBackend/CBackend.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPBackend.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/VMCore/Core.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Target/CBackend/CBackend.cpp b/llvm/lib/Target/CBackend/CBackend.cpp index 5b9a0a2..73c8225 100644 --- a/llvm/lib/Target/CBackend/CBackend.cpp +++ b/llvm/lib/Target/CBackend/CBackend.cpp @@ -363,7 +363,7 @@ static std::string CBEMangle(const std::string &S) { } std::string CWriter::getStructName(StructType *ST) { - if (!ST->isAnonymous() && !ST->getName().empty()) + if (!ST->isLiteral() && !ST->getName().empty()) return CBEMangle("l_"+ST->getName().str()); return "l_unnamed_" + utostr(UnnamedStructIDs[ST]); @@ -2052,7 +2052,7 @@ void CWriter::printModuleTypes() { for (unsigned i = 0, e = StructTypes.size(); i != e; ++i) { StructType *ST = StructTypes[i]; - if (ST->isAnonymous() || ST->getName().empty()) + if (ST->isLiteral() || ST->getName().empty()) UnnamedStructIDs[ST] = NextTypeID++; std::string Name = getStructName(ST); diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp index f16cfac..204a14f 100644 --- a/llvm/lib/Target/CppBackend/CPPBackend.cpp +++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp @@ -533,9 +533,9 @@ void CppWriter::printType(Type* Ty) { } case Type::StructTyID: { StructType* ST = cast<StructType>(Ty); - if (!ST->isAnonymous()) { + if (!ST->isLiteral()) { Out << "StructType *" << typeName << " = "; - Out << "StructType::createNamed(mod->getContext(), \""; + Out << "StructType::create(mod->getContext(), \""; printEscapedString(ST->getName()); Out << "\");"; nl(Out); @@ -556,7 +556,7 @@ void CppWriter::printType(Type* Ty) { nl(Out); } - if (ST->isAnonymous()) { + if (ST->isLiteral()) { Out << "StructType *" << typeName << " = "; Out << "StructType::get(" << "mod->getContext(), "; } else { diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 005f51a..62214a1 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -171,7 +171,7 @@ void TypePrinting::incorporateTypes(const Module &M) { StructType *STy = *I; // Ignore anonymous types. - if (STy->isAnonymous()) + if (STy->isLiteral()) continue; if (STy->getName().empty()) @@ -221,7 +221,7 @@ void TypePrinting::print(Type *Ty, raw_ostream &OS) { case Type::StructTyID: { StructType *STy = cast<StructType>(Ty); - if (STy->isAnonymous()) + if (STy->isLiteral()) return printStructBody(STy, OS); if (!STy->getName().empty()) @@ -2024,7 +2024,7 @@ void Type::print(raw_ostream &OS) const { // If the type is a named struct type, print the body as well. if (StructType *STy = dyn_cast<StructType>(const_cast<Type*>(this))) - if (!STy->isAnonymous()) { + if (!STy->isLiteral()) { OS << " = type "; TP.printStructBody(STy, OS); } diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index bff0d86..883ad91 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -299,7 +299,7 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name) { - return wrap(StructType::createNamed(*unwrap(C), Name)); + return wrap(StructType::create(*unwrap(C), Name)); } void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, |