mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-15 04:00:56 +00:00
[NFS] Wipe trailing whitespaces
This patch is a preparation for another one containing meaningful changes. This patch simply removes trailing whitespaces in few files affected by the upcoming patch and reformats llvm-svn: 336330
This commit is contained in:
parent
4a03201324
commit
7cf29bc028
@ -64,7 +64,8 @@ static SymbolQualitySignals::SymbolCategory categorize(const NamedDecl &ND) {
|
||||
return Switch().Visit(&ND);
|
||||
}
|
||||
|
||||
static SymbolQualitySignals::SymbolCategory categorize(const CodeCompletionResult &R) {
|
||||
static SymbolQualitySignals::SymbolCategory
|
||||
categorize(const CodeCompletionResult &R) {
|
||||
if (R.Declaration)
|
||||
return categorize(*R.Declaration);
|
||||
if (R.Kind == CodeCompletionResult::RK_Macro)
|
||||
@ -72,57 +73,57 @@ static SymbolQualitySignals::SymbolCategory categorize(const CodeCompletionResul
|
||||
// Everything else is a keyword or a pattern. Patterns are mostly keywords
|
||||
// too, except a few which we recognize by cursor kind.
|
||||
switch (R.CursorKind) {
|
||||
case CXCursor_CXXMethod:
|
||||
return SymbolQualitySignals::Function;
|
||||
case CXCursor_ModuleImportDecl:
|
||||
return SymbolQualitySignals::Namespace;
|
||||
case CXCursor_MacroDefinition:
|
||||
return SymbolQualitySignals::Macro;
|
||||
case CXCursor_TypeRef:
|
||||
return SymbolQualitySignals::Type;
|
||||
case CXCursor_MemberRef:
|
||||
return SymbolQualitySignals::Variable;
|
||||
default:
|
||||
return SymbolQualitySignals::Keyword;
|
||||
case CXCursor_CXXMethod:
|
||||
return SymbolQualitySignals::Function;
|
||||
case CXCursor_ModuleImportDecl:
|
||||
return SymbolQualitySignals::Namespace;
|
||||
case CXCursor_MacroDefinition:
|
||||
return SymbolQualitySignals::Macro;
|
||||
case CXCursor_TypeRef:
|
||||
return SymbolQualitySignals::Type;
|
||||
case CXCursor_MemberRef:
|
||||
return SymbolQualitySignals::Variable;
|
||||
default:
|
||||
return SymbolQualitySignals::Keyword;
|
||||
}
|
||||
}
|
||||
|
||||
static SymbolQualitySignals::SymbolCategory
|
||||
categorize(const index::SymbolInfo &D) {
|
||||
switch (D.Kind) {
|
||||
case index::SymbolKind::Namespace:
|
||||
case index::SymbolKind::NamespaceAlias:
|
||||
return SymbolQualitySignals::Namespace;
|
||||
case index::SymbolKind::Macro:
|
||||
return SymbolQualitySignals::Macro;
|
||||
case index::SymbolKind::Enum:
|
||||
case index::SymbolKind::Struct:
|
||||
case index::SymbolKind::Class:
|
||||
case index::SymbolKind::Protocol:
|
||||
case index::SymbolKind::Extension:
|
||||
case index::SymbolKind::Union:
|
||||
case index::SymbolKind::TypeAlias:
|
||||
return SymbolQualitySignals::Type;
|
||||
case index::SymbolKind::Function:
|
||||
case index::SymbolKind::ClassMethod:
|
||||
case index::SymbolKind::InstanceMethod:
|
||||
case index::SymbolKind::StaticMethod:
|
||||
case index::SymbolKind::InstanceProperty:
|
||||
case index::SymbolKind::ClassProperty:
|
||||
case index::SymbolKind::StaticProperty:
|
||||
case index::SymbolKind::Constructor:
|
||||
case index::SymbolKind::Destructor:
|
||||
case index::SymbolKind::ConversionFunction:
|
||||
return SymbolQualitySignals::Function;
|
||||
case index::SymbolKind::Variable:
|
||||
case index::SymbolKind::Field:
|
||||
case index::SymbolKind::EnumConstant:
|
||||
case index::SymbolKind::Parameter:
|
||||
return SymbolQualitySignals::Variable;
|
||||
case index::SymbolKind::Using:
|
||||
case index::SymbolKind::Module:
|
||||
case index::SymbolKind::Unknown:
|
||||
return SymbolQualitySignals::Unknown;
|
||||
case index::SymbolKind::Namespace:
|
||||
case index::SymbolKind::NamespaceAlias:
|
||||
return SymbolQualitySignals::Namespace;
|
||||
case index::SymbolKind::Macro:
|
||||
return SymbolQualitySignals::Macro;
|
||||
case index::SymbolKind::Enum:
|
||||
case index::SymbolKind::Struct:
|
||||
case index::SymbolKind::Class:
|
||||
case index::SymbolKind::Protocol:
|
||||
case index::SymbolKind::Extension:
|
||||
case index::SymbolKind::Union:
|
||||
case index::SymbolKind::TypeAlias:
|
||||
return SymbolQualitySignals::Type;
|
||||
case index::SymbolKind::Function:
|
||||
case index::SymbolKind::ClassMethod:
|
||||
case index::SymbolKind::InstanceMethod:
|
||||
case index::SymbolKind::StaticMethod:
|
||||
case index::SymbolKind::InstanceProperty:
|
||||
case index::SymbolKind::ClassProperty:
|
||||
case index::SymbolKind::StaticProperty:
|
||||
case index::SymbolKind::Constructor:
|
||||
case index::SymbolKind::Destructor:
|
||||
case index::SymbolKind::ConversionFunction:
|
||||
return SymbolQualitySignals::Function;
|
||||
case index::SymbolKind::Variable:
|
||||
case index::SymbolKind::Field:
|
||||
case index::SymbolKind::EnumConstant:
|
||||
case index::SymbolKind::Parameter:
|
||||
return SymbolQualitySignals::Variable;
|
||||
case index::SymbolKind::Using:
|
||||
case index::SymbolKind::Module:
|
||||
case index::SymbolKind::Unknown:
|
||||
return SymbolQualitySignals::Unknown;
|
||||
}
|
||||
llvm_unreachable("Unknown index::SymbolKind");
|
||||
}
|
||||
@ -160,22 +161,22 @@ float SymbolQualitySignals::evaluate() const {
|
||||
Score *= 0.1f;
|
||||
|
||||
switch (Category) {
|
||||
case Keyword: // Often relevant, but misses most signals.
|
||||
Score *= 4; // FIXME: important keywords should have specific boosts.
|
||||
break;
|
||||
case Type:
|
||||
case Function:
|
||||
case Variable:
|
||||
Score *= 1.1f;
|
||||
break;
|
||||
case Namespace:
|
||||
Score *= 0.8f;
|
||||
break;
|
||||
case Macro:
|
||||
Score *= 0.2f;
|
||||
break;
|
||||
case Unknown:
|
||||
break;
|
||||
case Keyword: // Often relevant, but misses most signals.
|
||||
Score *= 4; // FIXME: important keywords should have specific boosts.
|
||||
break;
|
||||
case Type:
|
||||
case Function:
|
||||
case Variable:
|
||||
Score *= 1.1f;
|
||||
break;
|
||||
case Namespace:
|
||||
Score *= 0.8f;
|
||||
break;
|
||||
case Macro:
|
||||
Score *= 0.2f;
|
||||
break;
|
||||
case Unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return Score;
|
||||
|
@ -554,14 +554,14 @@ private:
|
||||
|
||||
/// The availability of this code-completion result.
|
||||
unsigned Availability : 2;
|
||||
|
||||
|
||||
/// The name of the parent context.
|
||||
StringRef ParentName;
|
||||
|
||||
/// A brief documentation comment attached to the declaration of
|
||||
/// entity being completed by this result.
|
||||
const char *BriefComment;
|
||||
|
||||
|
||||
CodeCompletionString(const Chunk *Chunks, unsigned NumChunks,
|
||||
unsigned Priority, CXAvailabilityKind Availability,
|
||||
const char **Annotations, unsigned NumAnnotations,
|
||||
@ -599,7 +599,7 @@ public:
|
||||
|
||||
/// Retrieve the annotation string specified by \c AnnotationNr.
|
||||
const char *getAnnotation(unsigned AnnotationNr) const;
|
||||
|
||||
|
||||
/// Retrieve the name of the parent context.
|
||||
StringRef getParentContextName() const {
|
||||
return ParentName;
|
||||
@ -608,7 +608,7 @@ public:
|
||||
const char *getBriefComment() const {
|
||||
return BriefComment;
|
||||
}
|
||||
|
||||
|
||||
/// Retrieve a string representation of the code completion string,
|
||||
/// which is mainly useful for debugging.
|
||||
std::string getAsString() const;
|
||||
@ -669,7 +669,7 @@ private:
|
||||
CXAvailabilityKind Availability = CXAvailability_Available;
|
||||
StringRef ParentName;
|
||||
const char *BriefComment = nullptr;
|
||||
|
||||
|
||||
/// The chunks stored in this string.
|
||||
SmallVector<Chunk, 4> Chunks;
|
||||
|
||||
@ -728,7 +728,7 @@ public:
|
||||
|
||||
const char *getBriefComment() const { return BriefComment; }
|
||||
void addBriefComment(StringRef Comment);
|
||||
|
||||
|
||||
StringRef getParentName() const { return ParentName; }
|
||||
};
|
||||
|
||||
@ -886,8 +886,8 @@ public:
|
||||
StartsNestedNameSpecifier(false), AllParametersAreInformative(false),
|
||||
DeclaringEntity(false) {
|
||||
computeCursorKindAndAvailability();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Retrieve the declaration stored in this result.
|
||||
const NamedDecl *getDeclaration() const {
|
||||
assert(Kind == RK_Declaration && "Not a declaration result");
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user