summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
committerdim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
commitc49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch)
treec5e9e10bc189de0058aa763c47b9920a8351b7df /tools
parent110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff)
downloadFreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip
FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'tools')
-rw-r--r--tools/c-index-test/c-index-test.c54
-rw-r--r--tools/driver/cc1as_main.cpp2
-rw-r--r--tools/libclang/CIndex.cpp114
-rw-r--r--tools/libclang/CIndexCodeCompletion.cpp3
-rw-r--r--tools/libclang/CIndexDiagnostic.cpp3
-rw-r--r--tools/libclang/CIndexUSRs.cpp3
-rw-r--r--tools/libclang/CIndexer.h3
-rw-r--r--tools/libclang/CXCursor.cpp1
-rw-r--r--tools/libclang/CXType.cpp7
-rw-r--r--tools/libclang/libclang.darwin.exports2
-rw-r--r--tools/libclang/libclang.exports2
11 files changed, 148 insertions, 46 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index f7b7a36..837fc89 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -37,6 +37,8 @@ static unsigned getDefaultParsingOptions() {
options |= clang_defaultEditingTranslationUnitOptions();
if (getenv("CINDEXTEST_COMPLETION_CACHING"))
options |= CXTranslationUnit_CacheCompletionResults;
+ if (getenv("CINDEXTEST_NESTED_MACROS"))
+ options |= CXTranslationUnit_NestedMacroInstantiations;
return options;
}
@@ -158,7 +160,7 @@ int parse_remapped_files(int argc, const char **argv, int start_arg,
int want_display_name = 0;
-static void PrintCursor(CXCursor Cursor) {
+static void PrintCursor(CXTranslationUnit TU, CXCursor Cursor) {
if (clang_isInvalid(Cursor.kind)) {
CXString ks = clang_getCursorKindSpelling(Cursor.kind);
printf("Invalid Cursor => %s", clang_getCString(ks));
@@ -219,6 +221,11 @@ static void PrintCursor(CXCursor Cursor) {
break;
}
+ if (clang_CXXMethod_isStatic(Cursor))
+ printf(" (static)");
+ if (clang_CXXMethod_isVirtual(Cursor))
+ printf(" (virtual)");
+
if (Cursor.kind == CXCursor_IBOutletCollectionAttr) {
CXType T =
clang_getCanonicalType(clang_getIBOutletCollectionType(Cursor));
@@ -277,6 +284,9 @@ static void PrintCursor(CXCursor Cursor) {
CXString Included = clang_getFileName(File);
printf(" (%s)", clang_getCString(Included));
clang_disposeString(Included);
+
+ if (clang_isFileMultipleIncludeGuarded(TU, File))
+ printf(" [multi-include guarded]");
}
}
}
@@ -426,7 +436,7 @@ enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor,
clang_getSpellingLocation(Loc, 0, &line, &column, 0);
printf("// %s: %s:%d:%d: ", FileCheckPrefix,
GetCursorSource(Cursor), line, column);
- PrintCursor(Cursor);
+ PrintCursor(Data->TU, Cursor);
PrintCursorExtent(Cursor);
printf("\n");
return CXChildVisit_Recurse;
@@ -479,7 +489,7 @@ static enum CXChildVisitResult FunctionScanVisitor(CXCursor Cursor,
} else if (Ref.kind != CXCursor_FunctionDecl) {
printf("// %s: %s:%d:%d: ", FileCheckPrefix, GetCursorSource(Ref),
curLine, curColumn);
- PrintCursor(Ref);
+ PrintCursor(Data->TU, Ref);
printf("\n");
}
}
@@ -554,6 +564,8 @@ static enum CXChildVisitResult PrintLinkage(CXCursor cursor, CXCursor p,
CXClientData d) {
const char *linkage = 0;
+ VisitorData *Data = (VisitorData *)d;
+
if (clang_isInvalid(clang_getCursorKind(cursor)))
return CXChildVisit_Recurse;
@@ -566,7 +578,7 @@ static enum CXChildVisitResult PrintLinkage(CXCursor cursor, CXCursor p,
}
if (linkage) {
- PrintCursor(cursor);
+ PrintCursor(Data->TU, cursor);
printf("linkage=%s\n", linkage);
}
@@ -579,11 +591,12 @@ static enum CXChildVisitResult PrintLinkage(CXCursor cursor, CXCursor p,
static enum CXChildVisitResult PrintTypeKind(CXCursor cursor, CXCursor p,
CXClientData d) {
+ VisitorData *Data = (VisitorData *)d;
if (!clang_isInvalid(clang_getCursorKind(cursor))) {
CXType T = clang_getCursorType(cursor);
CXString S = clang_getTypeKindSpelling(T.kind);
- PrintCursor(cursor);
+ PrintCursor(Data->TU, cursor);
printf(" typekind=%s", clang_getCString(S));
if (clang_isConstQualifiedType(T))
printf(" const");
@@ -707,11 +720,11 @@ int perform_test_load_source(int argc, const char **argv,
return -1;
}
- TU = clang_createTranslationUnitFromSourceFile(Idx, 0,
- argc - num_unsaved_files,
- argv + num_unsaved_files,
- num_unsaved_files,
- unsaved_files);
+ TU = clang_parseTranslationUnit(Idx, 0,
+ argv + num_unsaved_files,
+ argc - num_unsaved_files,
+ unsaved_files, num_unsaved_files,
+ getDefaultParsingOptions());
if (!TU) {
fprintf(stderr, "Unable to load translation unit!\n");
free_remapped_files(unsaved_files, num_unsaved_files);
@@ -778,7 +791,7 @@ int perform_test_reparse_source(int argc, const char **argv, int trials,
/* Logic for testing clang_getCursor(). */
/******************************************************************************/
-static void print_cursor_file_scan(CXCursor cursor,
+static void print_cursor_file_scan(CXTranslationUnit TU, CXCursor cursor,
unsigned start_line, unsigned start_col,
unsigned end_line, unsigned end_col,
const char *prefix) {
@@ -787,7 +800,7 @@ static void print_cursor_file_scan(CXCursor cursor,
printf("-%s", prefix);
PrintExtent(stdout, start_line, start_col, end_line, end_col);
printf(" ");
- PrintCursor(cursor);
+ PrintCursor(TU, cursor);
printf("\n");
}
@@ -832,7 +845,7 @@ static int perform_file_scan(const char *ast_file, const char *source_file,
cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col));
if ((c == EOF || !clang_equalCursors(cursor, prevCursor)) &&
prevCursor.kind != CXCursor_InvalidFile) {
- print_cursor_file_scan(prevCursor, start_line, start_col,
+ print_cursor_file_scan(TU, prevCursor, start_line, start_col,
line, col, prefix);
start_line = line;
start_col = col;
@@ -1183,7 +1196,7 @@ int inspect_cursor_at(int argc, const char **argv) {
clang_getLocation(TU, file, Locations[Loc].line,
Locations[Loc].column));
if (I + 1 == Repeats) {
- PrintCursor(Cursor);
+ PrintCursor(TU, Cursor);
printf("\n");
free(Locations[Loc].filename);
}
@@ -1225,11 +1238,12 @@ int perform_token_annotation(int argc, const char **argv) {
return -1;
CIdx = clang_createIndex(0, 1);
- TU = clang_createTranslationUnitFromSourceFile(CIdx, argv[argc - 1],
- argc - num_unsaved_files - 3,
- argv + num_unsaved_files + 2,
- num_unsaved_files,
- unsaved_files);
+ TU = clang_parseTranslationUnit(CIdx, argv[argc - 1],
+ argv + num_unsaved_files + 2,
+ argc - num_unsaved_files - 3,
+ unsaved_files,
+ num_unsaved_files,
+ getDefaultParsingOptions());
if (!TU) {
fprintf(stderr, "unable to parse input\n");
clang_disposeIndex(CIdx);
@@ -1287,7 +1301,7 @@ int perform_token_annotation(int argc, const char **argv) {
PrintExtent(stdout, start_line, start_column, end_line, end_column);
if (!clang_isInvalid(cursors[i].kind)) {
printf(" ");
- PrintCursor(cursors[i]);
+ PrintCursor(TU, cursors[i]);
}
printf("\n");
}
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index ec6ce65..f449235 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -172,6 +172,8 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
}
}
Opts.LLVMArgs = Args->getAllArgValues(OPT_mllvm);
+ if (Args->hasArg(OPT_fatal_warnings))
+ Opts.LLVMArgs.push_back("-fatal-assembler-warnings");
Opts.OutputPath = Args->getLastArgValue(OPT_o);
if (Arg *A = Args->getLastArg(OPT_filetype)) {
StringRef Name = A->getValue(*Args);
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 28f1506..2a9d96d 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -30,6 +30,7 @@
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Lex/Lexer.h"
+#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/PreprocessingRecord.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/STLExtras.h"
@@ -349,6 +350,7 @@ public:
bool VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL);
bool VisitPackExpansionTypeLoc(PackExpansionTypeLoc TL);
bool VisitTypeOfTypeLoc(TypeOfTypeLoc TL);
+ bool VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL);
bool VisitDependentNameTypeLoc(DependentNameTypeLoc TL);
bool VisitDependentTemplateSpecializationTypeLoc(
DependentTemplateSpecializationTypeLoc TL);
@@ -789,7 +791,7 @@ bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) {
// FIXME: Attributes?
}
- if (ND->isThisDeclarationADefinition() && !ND->isLateTemplateParsed()) {
+ if (ND->doesThisDeclarationHaveABody() && !ND->isLateTemplateParsed()) {
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(ND)) {
// Find the initializers that were written in the source.
llvm::SmallVector<CXXCtorInitializer *, 4> WrittenInits;
@@ -1552,6 +1554,13 @@ bool CursorVisitor::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {
return false;
}
+bool CursorVisitor::VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {
+ if (TypeSourceInfo *TSInfo = TL.getUnderlyingTInfo())
+ return Visit(TSInfo->getTypeLoc());
+
+ return false;
+}
+
bool CursorVisitor::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
if (VisitNestedNameSpecifierLoc(TL.getQualifierLoc()))
return true;
@@ -2375,10 +2384,12 @@ clang_createTranslationUnitFromSourceFile(CXIndex CIdx,
const char * const *command_line_args,
unsigned num_unsaved_files,
struct CXUnsavedFile *unsaved_files) {
+ unsigned Options = CXTranslationUnit_DetailedPreprocessingRecord |
+ CXTranslationUnit_NestedMacroInstantiations;
return clang_parseTranslationUnit(CIdx, source_filename,
command_line_args, num_command_line_args,
unsaved_files, num_unsaved_files,
- CXTranslationUnit_DetailedPreprocessingRecord);
+ Options);
}
struct ParseTranslationUnitInfo {
@@ -2479,9 +2490,12 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
Args->push_back(source_filename);
// Do we need the detailed preprocessing record?
+ bool NestedMacroInstantiations = false;
if (options & CXTranslationUnit_DetailedPreprocessingRecord) {
Args->push_back("-Xclang");
Args->push_back("-detailed-preprocessing-record");
+ NestedMacroInstantiations
+ = (options & CXTranslationUnit_NestedMacroInstantiations);
}
unsigned NumErrors = Diags->getClient()->getNumErrors();
@@ -2500,7 +2514,8 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
CompleteTranslationUnit,
CacheCodeCompetionResults,
CXXPrecompilePreamble,
- CXXChainedPCH));
+ CXXChainedPCH,
+ NestedMacroInstantiations));
if (NumErrors != Diags->getClient()->getNumErrors()) {
// Make sure to check that 'Unit' is non-NULL.
@@ -2559,8 +2574,10 @@ CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx,
fprintf(stderr, "}\n");
return 0;
+ } else if (getenv("LIBCLANG_RESOURCE_USAGE")) {
+ PrintLibclangResourceUsage(PTUI.result);
}
-
+
return PTUI.result;
}
@@ -2573,7 +2590,10 @@ int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName,
if (!TU)
return 1;
- return static_cast<ASTUnit *>(TU->TUData)->Save(FileName);
+ int result = static_cast<ASTUnit *>(TU->TUData)->Save(FileName);
+ if (getenv("LIBCLANG_RESOURCE_USAGE"))
+ PrintLibclangResourceUsage(TU);
+ return result;
}
void clang_disposeTranslationUnit(CXTranslationUnit CTUnit) {
@@ -2649,8 +2669,8 @@ int clang_reparseTranslationUnit(CXTranslationUnit TU,
fprintf(stderr, "libclang: crash detected during reparsing\n");
static_cast<ASTUnit *>(TU->TUData)->setUnsafeToFree(true);
return 1;
- }
-
+ } else if (getenv("LIBCLANG_RESOURCE_USAGE"))
+ PrintLibclangResourceUsage(TU);
return RTUI.result;
}
@@ -2807,17 +2827,8 @@ void clang_getSpellingLocation(CXSourceLocation location,
unsigned *offset) {
SourceLocation Loc = SourceLocation::getFromRawEncoding(location.int_data);
- if (!location.ptr_data[0] || Loc.isInvalid()) {
- if (file)
- *file = 0;
- if (line)
- *line = 0;
- if (column)
- *column = 0;
- if (offset)
- *offset = 0;
- return;
- }
+ if (!location.ptr_data[0] || Loc.isInvalid())
+ return createNullLocation(file, line, column, offset);
const SourceManager &SM =
*static_cast<const SourceManager*>(location.ptr_data[0]);
@@ -2835,6 +2846,9 @@ void clang_getSpellingLocation(CXSourceLocation location,
FileID FID = LocInfo.first;
unsigned FileOffset = LocInfo.second;
+ if (FID.isInvalid())
+ return createNullLocation(file, line, column, offset);
+
if (file)
*file = (void *)SM.getFileEntryForID(FID);
if (line)
@@ -2890,6 +2904,16 @@ CXFile clang_getFile(CXTranslationUnit tu, const char *file_name) {
return const_cast<FileEntry *>(FMgr.getFile(file_name));
}
+unsigned clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file) {
+ if (!tu || !file)
+ return 0;
+
+ ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu->TUData);
+ FileEntry *FEnt = static_cast<FileEntry *>(file);
+ return CXXUnit->getPreprocessor().getHeaderSearchInfo()
+ .isFileMultipleIncludeGuarded(FEnt);
+}
+
} // end: extern "C"
//===----------------------------------------------------------------------===//
@@ -3357,7 +3381,11 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
case CXCursor_UsingDeclaration:
return createCXString("UsingDeclaration");
case CXCursor_TypeAliasDecl:
- return createCXString("TypeAliasDecl");
+ return createCXString("TypeAliasDecl");
+ case CXCursor_ObjCSynthesizeDecl:
+ return createCXString("ObjCSynthesizeDecl");
+ case CXCursor_ObjCDynamicDecl:
+ return createCXString("ObjCDynamicDecl");
}
llvm_unreachable("Unhandled CXCursorKind");
@@ -3899,6 +3927,7 @@ CXCursor clang_getCursorDefinition(CXCursor C) {
case Decl::Namespace:
case Decl::Typedef:
case Decl::TypeAlias:
+ case Decl::TypeAliasTemplate:
case Decl::TemplateTypeParm:
case Decl::EnumConstant:
case Decl::Field:
@@ -5169,6 +5198,19 @@ unsigned clang_CXXMethod_isStatic(CXCursor C) {
return (Method && Method->isStatic()) ? 1 : 0;
}
+unsigned clang_CXXMethod_isVirtual(CXCursor C) {
+ if (!clang_isDeclaration(C.kind))
+ return 0;
+
+ CXXMethodDecl *Method = 0;
+ Decl *D = cxcursor::getCursorDecl(C);
+ if (FunctionTemplateDecl *FunTmpl = dyn_cast_or_null<FunctionTemplateDecl>(D))
+ Method = dyn_cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
+ else
+ Method = dyn_cast_or_null<CXXMethodDecl>(D);
+ return (Method && Method->isVirtual()) ? 1 : 0;
+}
+
} // end: extern "C"
//===----------------------------------------------------------------------===//
@@ -5235,6 +5277,12 @@ const char *clang_getTUResourceUsageName(CXTUResourceUsageKind kind) {
case CXTUResourceUsage_ExternalASTSource_Membuffer_MMap:
str = "ExternalASTSource: mmap'ed memory buffers";
break;
+ case CXTUResourceUsage_Preprocessor:
+ str = "Preprocessor: malloc'ed memory";
+ break;
+ case CXTUResourceUsage_PreprocessingRecord:
+ str = "Preprocessor: PreprocessingRecord";
+ break;
}
return str;
}
@@ -5269,7 +5317,7 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
unsigned long completionBytes = 0;
if (GlobalCodeCompletionAllocator *completionAllocator =
astUnit->getCachedCompletionAllocator().getPtr()) {
- completionBytes = completionAllocator-> getTotalMemory();
+ completionBytes = completionAllocator->getTotalMemory();
}
createCXTUResourceUsageEntry(*entries,
CXTUResourceUsage_GlobalCompletionResults,
@@ -5303,7 +5351,21 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
CXTUResourceUsage_ExternalASTSource_Membuffer_MMap,
(unsigned long) sizes.mmap_bytes);
}
-
+
+ // How much memory is being used by the Preprocessor?
+ Preprocessor &pp = astUnit->getPreprocessor();
+ const llvm::BumpPtrAllocator &ppAlloc = pp.getPreprocessorAllocator();
+ createCXTUResourceUsageEntry(*entries,
+ CXTUResourceUsage_Preprocessor,
+ ppAlloc.getTotalMemory());
+
+ if (PreprocessingRecord *pRec = pp.getPreprocessingRecord()) {
+ createCXTUResourceUsageEntry(*entries,
+ CXTUResourceUsage_PreprocessingRecord,
+ pRec->getTotalMemory());
+ }
+
+
CXTUResourceUsage usage = { (void*) entries.get(),
(unsigned) entries->size(),
entries->size() ? &(*entries)[0] : 0 };
@@ -5318,6 +5380,16 @@ void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage) {
} // end extern "C"
+void clang::PrintLibclangResourceUsage(CXTranslationUnit TU) {
+ CXTUResourceUsage Usage = clang_getCXTUResourceUsage(TU);
+ for (unsigned I = 0; I != Usage.numEntries; ++I)
+ fprintf(stderr, " %s: %lu\n",
+ clang_getTUResourceUsageName(Usage.entries[I].kind),
+ Usage.entries[I].amount);
+
+ clang_disposeCXTUResourceUsage(Usage);
+}
+
//===----------------------------------------------------------------------===//
// Misc. utility functions.
//===----------------------------------------------------------------------===//
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index e85e802..0c8317e 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/tools/libclang/CIndexCodeCompletion.cpp
@@ -498,7 +498,8 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
fprintf(stderr, "libclang: crash detected in code completion\n");
static_cast<ASTUnit *>(TU->TUData)->setUnsafeToFree(true);
return 0;
- }
+ } else if (getenv("LIBCLANG_RESOURCE_USAGE"))
+ PrintLibclangResourceUsage(TU);
return CCAI.result;
}
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp
index fa3b1ce..0fcdab7 100644
--- a/tools/libclang/CIndexDiagnostic.cpp
+++ b/tools/libclang/CIndexDiagnostic.cpp
@@ -220,7 +220,8 @@ CXString clang_getDiagnosticOption(CXDiagnostic Diag, CXString *Disable) {
return createCXString("");
unsigned ID = StoredDiag->Diag.getID();
- if (const char *Option = DiagnosticIDs::getWarningOptionForDiag(ID)) {
+ llvm::StringRef Option = DiagnosticIDs::getWarningOptionForDiag(ID);
+ if (!Option.empty()) {
if (Disable)
*Disable = createCXString((llvm::Twine("-Wno-") + Option).str());
return createCXString((llvm::Twine("-W") + Option).str());
diff --git a/tools/libclang/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp
index 9917d2a..4f1f071 100644
--- a/tools/libclang/CIndexUSRs.cpp
+++ b/tools/libclang/CIndexUSRs.cpp
@@ -477,6 +477,9 @@ bool USRGenerator::GenLoc(const Decl *D) {
return true;
}
+ // Use the location of canonical decl.
+ D = D->getCanonicalDecl();
+
const SourceManager &SM = AU->getSourceManager();
SourceLocation L = D->getLocStart();
if (L.isInvalid()) {
diff --git a/tools/libclang/CIndexer.h b/tools/libclang/CIndexer.h
index b40891a..45d0831 100644
--- a/tools/libclang/CIndexer.h
+++ b/tools/libclang/CIndexer.h
@@ -77,6 +77,9 @@ namespace clang {
/// \return False if a crash was detected.
bool RunSafely(llvm::CrashRecoveryContext &CRC,
void (*Fn)(void*), void *UserData, unsigned Size = 0);
+
+ /// \brief Print libclang's resource usage to standard error.
+ void PrintLibclangResourceUsage(CXTranslationUnit TU);
}
#endif
diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp
index 2a78012..b34370d 100644
--- a/tools/libclang/CXCursor.cpp
+++ b/tools/libclang/CXCursor.cpp
@@ -173,6 +173,7 @@ CXCursor cxcursor::MakeCXCursor(Stmt *S, Decl *Parent,
case Stmt::OpaqueValueExprClass:
case Stmt::PackExpansionExprClass:
case Stmt::SizeOfPackExprClass:
+ case Stmt::AsTypeExprClass:
K = CXCursor_UnexposedExpr;
break;
diff --git a/tools/libclang/CXType.cpp b/tools/libclang/CXType.cpp
index 9332672..5af9553 100644
--- a/tools/libclang/CXType.cpp
+++ b/tools/libclang/CXType.cpp
@@ -379,9 +379,10 @@ CXString clang_getDeclObjCTypeEncoding(CXCursor C) {
ASTContext &Ctx = AU->getASTContext();
std::string encoding;
- if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D))
- Ctx.getObjCEncodingForMethodDecl(OMD, encoding);
- else if (ObjCPropertyDecl *OPD = dyn_cast<ObjCPropertyDecl>(D))
+ if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {
+ if (Ctx.getObjCEncodingForMethodDecl(OMD, encoding))
+ return cxstring::createCXString("?");
+ } else if (ObjCPropertyDecl *OPD = dyn_cast<ObjCPropertyDecl>(D))
Ctx.getObjCEncodingForPropertyDecl(OPD, NULL, encoding);
else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
Ctx.getObjCEncodingForFunctionDecl(FD, encoding);
diff --git a/tools/libclang/libclang.darwin.exports b/tools/libclang/libclang.darwin.exports
index 30c3fd1..85dfcb6 100644
--- a/tools/libclang/libclang.darwin.exports
+++ b/tools/libclang/libclang.darwin.exports
@@ -1,6 +1,7 @@
_clang_CXCursorSet_contains
_clang_CXCursorSet_insert
_clang_CXXMethod_isStatic
+_clang_CXXMethod_isVirtual
_clang_annotateTokens
_clang_codeCompleteAt
_clang_codeCompleteGetDiagnostic
@@ -115,6 +116,7 @@ _clang_isConstQualifiedType
_clang_isCursorDefinition
_clang_isDeclaration
_clang_isExpression
+_clang_isFileMultipleIncludeGuarded
_clang_isInvalid
_clang_isPODType
_clang_isPreprocessing
diff --git a/tools/libclang/libclang.exports b/tools/libclang/libclang.exports
index 4e96e8a..403cd67 100644
--- a/tools/libclang/libclang.exports
+++ b/tools/libclang/libclang.exports
@@ -1,6 +1,7 @@
clang_CXCursorSet_contains
clang_CXCursorSet_insert
clang_CXXMethod_isStatic
+clang_CXXMethod_isVirtual
clang_annotateTokens
clang_codeCompleteAt
clang_codeCompleteGetDiagnostic
@@ -115,6 +116,7 @@ clang_isConstQualifiedType
clang_isCursorDefinition
clang_isDeclaration
clang_isExpression
+clang_isFileMultipleIncludeGuarded
clang_isInvalid
clang_isPODType
clang_isPreprocessing
OpenPOWER on IntegriCloud