summaryrefslogtreecommitdiffstats
path: root/clang/tools
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-07-14 08:41:15 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-07-14 08:41:15 +0000
commit9e4704ab07d28bd6d507d9d3861b3bd2076deaaa (patch)
treeec8222d654507981b8391f25ea6afacecc8fbabf /clang/tools
parenta88a221855f9d55f7e0e58105b05ab7e66462905 (diff)
downloadbcm5719-llvm-9e4704ab07d28bd6d507d9d3861b3bd2076deaaa.tar.gz
bcm5719-llvm-9e4704ab07d28bd6d507d9d3861b3bd2076deaaa.zip
Update all of the libclang code corresponding to the preprocessor
MacroInstantiation -> MacroExpansion rename. Internally, everything is switched. Introduce a new cursor kind enum with the new name, but retain the old name as an alias so that we don't break backwards compatibility. Also update the debug printing routine to use 'macro expansions' as its explicitly not guaranteed to be stable, and mechanically switch the test cases over to that. llvm-svn: 135140
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/libclang/CIndex.cpp16
-rw-r--r--clang/tools/libclang/CXCursor.cpp4
2 files changed, 10 insertions, 10 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index e85b94f4f72..02ef6f82c2a 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3151,7 +3151,7 @@ CXString clang_getCursorSpelling(CXCursor C) {
return createCXString("");
}
- if (C.kind == CXCursor_MacroInstantiation)
+ if (C.kind == CXCursor_MacroExpansion)
return createCXString(getCursorMacroExpansion(C)->getName()
->getNameStart());
@@ -3352,8 +3352,8 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
return createCXString("preprocessing directive");
case CXCursor_MacroDefinition:
return createCXString("macro definition");
- case CXCursor_MacroInstantiation:
- return createCXString("macro instantiation");
+ case CXCursor_MacroExpansion:
+ return createCXString("macro expansion");
case CXCursor_InclusionDirective:
return createCXString("inclusion directive");
case CXCursor_Namespace:
@@ -3672,7 +3672,7 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) {
return cxloc::translateSourceLocation(getCursorContext(C), L);
}
- if (C.kind == CXCursor_MacroInstantiation) {
+ if (C.kind == CXCursor_MacroExpansion) {
SourceLocation L
= cxcursor::getCursorMacroExpansion(C)->getSourceRange().getBegin();
return cxloc::translateSourceLocation(getCursorContext(C), L);
@@ -3759,7 +3759,7 @@ static SourceRange getRawCursorExtent(CXCursor C) {
if (C.kind == CXCursor_PreprocessingDirective)
return cxcursor::getCursorPreprocessingDirective(C);
- if (C.kind == CXCursor_MacroInstantiation)
+ if (C.kind == CXCursor_MacroExpansion)
return cxcursor::getCursorMacroExpansion(C)->getSourceRange();
if (C.kind == CXCursor_MacroDefinition)
@@ -3876,7 +3876,7 @@ CXCursor clang_getCursorReferenced(CXCursor C) {
return clang_getNullCursor();
}
- if (C.kind == CXCursor_MacroInstantiation) {
+ if (C.kind == CXCursor_MacroExpansion) {
if (MacroDefinition *Def = getCursorMacroExpansion(C)->getDefinition())
return MakeMacroDefinitionCursor(Def, tu);
}
@@ -3945,7 +3945,7 @@ CXCursor clang_getCursorDefinition(CXCursor C) {
WasReference = true;
}
- if (C.kind == CXCursor_MacroInstantiation)
+ if (C.kind == CXCursor_MacroExpansion)
return clang_getCursorReferenced(C);
if (!clang_isDeclaration(C.kind))
@@ -4543,7 +4543,7 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) {
if (clang_isPreprocessing(cursor.kind)) {
// For macro instantiations, just note where the beginning of the macro
// instantiation occurs.
- if (cursor.kind == CXCursor_MacroInstantiation) {
+ if (cursor.kind == CXCursor_MacroExpansion) {
Annotated[Loc.int_data] = cursor;
return CXChildVisit_Recurse;
}
diff --git a/clang/tools/libclang/CXCursor.cpp b/clang/tools/libclang/CXCursor.cpp
index b48ad910981..86997d6701a 100644
--- a/clang/tools/libclang/CXCursor.cpp
+++ b/clang/tools/libclang/CXCursor.cpp
@@ -380,12 +380,12 @@ MacroDefinition *cxcursor::getCursorMacroDefinition(CXCursor C) {
CXCursor cxcursor::MakeMacroExpansionCursor(MacroExpansion *MI,
CXTranslationUnit TU) {
- CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } };
+ CXCursor C = { CXCursor_MacroExpansion, { MI, 0, TU } };
return C;
}
MacroExpansion *cxcursor::getCursorMacroExpansion(CXCursor C) {
- assert(C.kind == CXCursor_MacroInstantiation);
+ assert(C.kind == CXCursor_MacroExpansion);
return static_cast<MacroExpansion *>(C.data[0]);
}
OpenPOWER on IntegriCloud