diff options
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 12 | ||||
-rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Basic/FileSystemStatCache.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 18 | ||||
-rw-r--r-- | clang/lib/Basic/Module.cpp | 28 | ||||
-rw-r--r-- | clang/lib/Basic/ObjCRuntime.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/SourceLocation.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 64 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/X86.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/X86.h | 8 | ||||
-rw-r--r-- | clang/lib/Basic/Warnings.cpp | 20 |
12 files changed, 91 insertions, 91 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 519e835e32a..f1ebd9d38b9 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -116,12 +116,12 @@ void DiagnosticsEngine::Reset() { UncompilableErrorOccurred = false; FatalErrorOccurred = false; UnrecoverableErrorOccurred = false; - + NumWarnings = 0; NumErrors = 0; TrapNumErrorsOccurred = 0; TrapNumUnrecoverableErrorsOccurred = 0; - + CurDiagID = std::numeric_limits<unsigned>::max(); LastDiagLevel = DiagnosticIDs::Ignored; DelayedDiagID = 0; @@ -759,7 +759,7 @@ FormatDiagnostic(SmallVectorImpl<char> &OutStr) const { return; } - StringRef Diag = + StringRef Diag = getDiags()->getDiagnosticIDs()->getDescription(getID()); FormatDiagnostic(Diag.begin(), Diag.end(), OutStr); @@ -880,7 +880,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, continue; } } - + switch (Kind) { // ---- STRINGS ---- case DiagnosticsEngine::ak_std_string: { @@ -1056,7 +1056,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, break; } } - + // Remember this argument info for subsequent formatting operations. Turn // std::strings into a null terminated string to make it be the same case as // all the other ones. @@ -1077,7 +1077,7 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, StringRef Message) : ID(ID), Level(Level), Message(Message) {} -StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, +StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info) : ID(Info.getID()), Level(Level) { assert((Info.getLocation().isInvalid() || Info.hasSourceManager()) && diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index 697de68a5af..8f2c3d06a50 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -685,7 +685,7 @@ bool DiagnosticIDs::ProcessDiag(DiagnosticsEngine &Diag) const { ++Diag.NumErrors; } - // If we've emitted a lot of errors, emit a fatal error instead of it to + // If we've emitted a lot of errors, emit a fatal error instead of it to // stop a flood of bogus errors. if (Diag.ErrorLimit && Diag.NumErrors > Diag.ErrorLimit && DiagLevel == DiagnosticIDs::Error) { diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 7e2d01c4981..d339b972ae8 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -71,7 +71,7 @@ void FileManager::addStatCache(std::unique_ptr<FileSystemStatCache> statCache, StatCache = std::move(statCache); return; } - + FileSystemStatCache *LastCache = StatCache.get(); while (LastCache->getNextStatCache()) LastCache = LastCache->getNextStatCache(); @@ -82,18 +82,18 @@ void FileManager::addStatCache(std::unique_ptr<FileSystemStatCache> statCache, void FileManager::removeStatCache(FileSystemStatCache *statCache) { if (!statCache) return; - + if (StatCache.get() == statCache) { // This is the first stat cache. StatCache = StatCache->takeNextStatCache(); return; } - + // Find the stat cache in the list. FileSystemStatCache *PrevCache = StatCache.get(); while (PrevCache && PrevCache->getNextStatCache() != statCache) PrevCache = PrevCache->getNextStatCache(); - + assert(PrevCache && "Stat cache not found for removal"); PrevCache->setNextStatCache(statCache->takeNextStatCache()); } @@ -247,7 +247,7 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile, return nullptr; } - + // FIXME: Use the directory info to prune this, before doing the stat syscall. // FIXME: This will reduce the # syscalls. @@ -394,7 +394,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size, bool FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const { StringRef pathRef(path.data(), path.size()); - if (FileSystemOpts.WorkingDir.empty() + if (FileSystemOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(pathRef)) return false; @@ -505,14 +505,14 @@ void FileManager::GetUniqueIDMapping( SmallVectorImpl<const FileEntry *> &UIDToFiles) const { UIDToFiles.clear(); UIDToFiles.resize(NextFileUID); - + // Map file entries for (llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator>::const_iterator FE = SeenFileEntries.begin(), FEEnd = SeenFileEntries.end(); FE != FEEnd; ++FE) if (FE->getValue() && FE->getValue() != NON_EXISTENT_FILE) UIDToFiles[FE->getValue()->getUID()] = FE->getValue(); - + // Map virtual file entries for (const auto &VFE : VirtualFileEntries) if (VFE && VFE.get() != NON_EXISTENT_FILE) diff --git a/clang/lib/Basic/FileSystemStatCache.cpp b/clang/lib/Basic/FileSystemStatCache.cpp index ebee32670e0..f5856cb6542 100644 --- a/clang/lib/Basic/FileSystemStatCache.cpp +++ b/clang/lib/Basic/FileSystemStatCache.cpp @@ -95,17 +95,17 @@ bool FileSystemStatCache::get(StringRef Path, FileData &Data, bool isFile, // If the path doesn't exist, return failure. if (R == CacheMissing) return true; - + // If the path exists, make sure that its "directoryness" matches the clients // demands. if (Data.IsDirectory != isForDir) { // If not, close the file if opened. if (F) *F = nullptr; - + return true; } - + return false; } @@ -120,7 +120,7 @@ MemorizeStatCalls::getStat(StringRef Path, FileData &Data, bool isFile, // entries). if (Result == CacheMissing) return Result; - + // Cache file 'stat' results and directories with absolutely paths. if (!Data.IsDirectory || llvm::sys::path::is_absolute(Path)) StatCalls[Path] = Data; diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 2fef481ae2c..7ec3cb7dd65 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -319,7 +319,7 @@ tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const { CASE( 6, 'i', 'n', ifndef); CASE( 6, 'i', 'p', import); CASE( 6, 'p', 'a', pragma); - + CASE( 7, 'd', 'f', defined); CASE( 7, 'i', 'c', include); CASE( 7, 'w', 'r', warning); @@ -328,7 +328,7 @@ tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const { CASE(12, 'i', 'c', include_next); CASE(14, '_', 'p', __public_macro); - + CASE(15, '_', 'p', __private_macro); CASE(16, '_', 'i', __include_macros); @@ -566,9 +566,9 @@ ObjCMethodFamily Selector::getMethodFamilyImpl(Selector sel) { ObjCInstanceTypeFamily Selector::getInstTypeMethodFamily(Selector sel) { IdentifierInfo *first = sel.getIdentifierInfoForSlot(0); if (!first) return OIT_None; - + StringRef name = first->getName(); - + if (name.empty()) return OIT_None; switch (name.front()) { case 'a': @@ -593,22 +593,22 @@ ObjCInstanceTypeFamily Selector::getInstTypeMethodFamily(Selector sel) { ObjCStringFormatFamily Selector::getStringFormatFamilyImpl(Selector sel) { IdentifierInfo *first = sel.getIdentifierInfoForSlot(0); if (!first) return SFF_None; - + StringRef name = first->getName(); - + switch (name.front()) { case 'a': if (name == "appendFormat") return SFF_NSString; break; - + case 'i': if (name == "initWithFormat") return SFF_NSString; break; - + case 'l': if (name == "localizedStringWithFormat") return SFF_NSString; break; - + case 's': if (name == "stringByAppendingFormat" || name == "stringWithFormat") return SFF_NSString; diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 2714b98120c..1a0c1905905 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -58,7 +58,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, if (Parent->ModuleMapIsPrivate) ModuleMapIsPrivate = true; IsMissingRequirement = Parent->IsMissingRequirement; - + Parent->SubModuleIndex[Name] = Parent->SubModules.size(); Parent->SubModules.push_back(this); } @@ -134,10 +134,10 @@ bool Module::isSubModuleOf(const Module *Other) const { do { if (This == Other) return true; - + This = This->Parent; } while (This); - + return false; } @@ -145,7 +145,7 @@ const Module *Module::getTopLevelModule() const { const Module *Result = this; while (Result->Parent) Result = Result->Parent; - + return Result; } @@ -181,16 +181,16 @@ static void printModuleId(raw_ostream &OS, const Container &C) { std::string Module::getFullModuleName(bool AllowStringLiterals) const { SmallVector<StringRef, 2> Names; - + // Build up the set of module names (from innermost to outermost). for (const Module *M = this; M; M = M->Parent) Names.push_back(M->Name); - + std::string Result; llvm::raw_string_ostream Out(Result); printModuleId(Out, Names.rbegin(), Names.rend(), AllowStringLiterals); - Out.flush(); + Out.flush(); return Result; } @@ -207,7 +207,7 @@ bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const { Module::DirectoryName Module::getUmbrellaDir() const { if (Header U = getUmbrellaHeader()) return {"", U.Entry->getDir()}; - + return {UmbrellaAsWritten, Umbrella.dyn_cast<const DirectoryEntry *>()}; } @@ -388,7 +388,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { } OS << " {\n"; - + if (!Requirements.empty()) { OS.indent(Indent + 2); OS << "requires "; @@ -401,7 +401,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { } OS << "\n"; } - + if (Header H = getUmbrellaHeader()) { OS.indent(Indent + 2); OS << "umbrella header \""; @@ -411,7 +411,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "umbrella \""; OS.write_escaped(D.NameAsWritten); - OS << "\"\n"; + OS << "\"\n"; } if (!ConfigMacros.empty() || ConfigMacrosExhaustive) { @@ -468,7 +468,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "export_as" << ExportAsModule << "\n"; } - + for (submodule_const_iterator MI = submodule_begin(), MIEnd = submodule_end(); MI != MIEnd; ++MI) // Print inferred subframework modules so that we don't need to re-infer @@ -477,7 +477,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { // those header files anyway. if (!(*MI)->IsInferred || (*MI)->IsFramework) (*MI)->print(OS, Indent + 2); - + for (unsigned I = 0, N = Exports.size(); I != N; ++I) { OS.indent(Indent + 2); OS << "export "; @@ -554,7 +554,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "}\n"; } - + OS.indent(Indent); OS << "}\n"; } diff --git a/clang/lib/Basic/ObjCRuntime.cpp b/clang/lib/Basic/ObjCRuntime.cpp index 8fa0afbe03f..311bd067261 100644 --- a/clang/lib/Basic/ObjCRuntime.cpp +++ b/clang/lib/Basic/ObjCRuntime.cpp @@ -27,7 +27,7 @@ std::string ObjCRuntime::getAsString() const { llvm::raw_string_ostream Out(Result); Out << *this; } - return Result; + return Result; } raw_ostream &clang::operator<<(raw_ostream &out, const ObjCRuntime &value) { diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp index fef1f44fc8a..eb916ec76fd 100644 --- a/clang/lib/Basic/SourceLocation.cpp +++ b/clang/lib/Basic/SourceLocation.cpp @@ -49,7 +49,7 @@ void SourceLocation::print(raw_ostream &OS, const SourceManager &SM)const{ if (isFileID()) { PresumedLoc PLoc = SM.getPresumedLoc(*this); - + if (PLoc.isInvalid()) { OS << "<invalid>"; return; diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index ae76817826e..efa6ad2493b 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -105,9 +105,9 @@ llvm::MemoryBuffer *ContentCache::getBuffer(DiagnosticsEngine &Diag, if (Buffer.getPointer() || !ContentsEntry) { if (Invalid) *Invalid = isBufferInvalid(); - + return Buffer.getPointer(); - } + } bool isVolatile = SM.userFilesAreVolatile() && !IsSystemFile; auto BufferOrError = @@ -141,7 +141,7 @@ llvm::MemoryBuffer *ContentCache::getBuffer(DiagnosticsEngine &Diag, << ContentsEntry->getName() << BufferOrError.getError().message(); Buffer.setInt(Buffer.getInt() | InvalidFlag); - + if (Invalid) *Invalid = true; return Buffer.getPointer(); } @@ -187,10 +187,10 @@ llvm::MemoryBuffer *ContentCache::getBuffer(DiagnosticsEngine &Diag, << InvalidBOM << ContentsEntry->getName(); Buffer.setInt(Buffer.getInt() | InvalidFlag); } - + if (Invalid) *Invalid = isBufferInvalid(); - + return Buffer.getPointer(); } @@ -672,7 +672,7 @@ StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { bool MyInvalid = false; const SLocEntry &SLoc = getSLocEntry(FID, &MyInvalid); if (!SLoc.isFile() || MyInvalid) { - if (Invalid) + if (Invalid) *Invalid = true; return "<<<<<INVALID SOURCE LOCATION>>>>>"; } @@ -684,7 +684,7 @@ StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { if (MyInvalid) return "<<<<<INVALID SOURCE LOCATION>>>>>"; - + return Buf->getBuffer(); } @@ -770,7 +770,7 @@ FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const { unsigned MidOffset = getLocalSLocEntry(MiddleIndex, &Invalid).getOffset(); if (Invalid) return FileID::get(0); - + ++NumProbes; // If the offset of the midpoint is too large, chop the high side of the @@ -1104,7 +1104,7 @@ const char *SourceManager::getCharacterData(SourceLocation SL, if (CharDataInvalid || !Entry.isFile()) { if (Invalid) *Invalid = true; - + return "<<<<INVALID BUFFER>>>>"; } llvm::MemoryBuffer *Buffer = Entry.getFile().getContentCache()->getBuffer( @@ -1289,7 +1289,7 @@ FoundSpecialChar: /// for the position indicated. This requires building and caching a table of /// line offsets for the MemoryBuffer, so this is not cheap: use only when /// about to emit a diagnostic. -unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos, +unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos, bool *Invalid) const { if (FID.isInvalid()) { if (Invalid) @@ -1308,10 +1308,10 @@ unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos, *Invalid = true; return 1; } - + Content = const_cast<ContentCache*>(Entry.getFile().getContentCache()); } - + // If this is the first use of line information for this buffer, compute the /// SourceLineCache for it on demand. if (!Content->SourceLineCache) { @@ -1383,7 +1383,7 @@ unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos, return LineNo; } -unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, +unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, bool *Invalid) const { if (isInvalid(Loc, Invalid)) return 0; std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); @@ -1418,7 +1418,7 @@ SourceManager::getFileCharacteristic(SourceLocation Loc) const { const SLocEntry &SEntry = getSLocEntry(LocInfo.first, &Invalid); if (Invalid || !SEntry.isFile()) return C_User; - + const SrcMgr::FileInfo &FI = SEntry.getFile(); // If there are no #line directives in this file, just return the whole-file @@ -1466,7 +1466,7 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, const SLocEntry &Entry = getSLocEntry(LocInfo.first, &Invalid); if (Invalid || !Entry.isFile()) return PresumedLoc(); - + const SrcMgr::FileInfo &FI = Entry.getFile(); const SrcMgr::ContentCache *C = FI.getContentCache(); @@ -1485,7 +1485,7 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, unsigned ColNo = getColumnNumber(LocInfo.first, LocInfo.second, &Invalid); if (Invalid) return PresumedLoc(); - + SourceLocation IncludeLoc = FI.getIncludeLoc(); // If we have #line directives in this file, update and overwrite the physical @@ -1621,7 +1621,7 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { const SLocEntry &MainSLoc = getSLocEntry(MainFileID, &Invalid); if (Invalid) return FileID(); - + if (MainSLoc.isFile()) { const ContentCache *MainContentCache = MainSLoc.getFile().getContentCache(); @@ -1658,8 +1658,8 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { const SLocEntry &SLoc = getLocalSLocEntry(I, &Invalid); if (Invalid) return FileID(); - - if (SLoc.isFile() && + + if (SLoc.isFile() && SLoc.getFile().getContentCache() && SLoc.getFile().getContentCache()->OrigEntry == SourceFile) { FirstFID = FileID::get(I); @@ -1670,7 +1670,7 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { if (FirstFID.isInvalid()) { for (unsigned I = 0, N = loaded_sloc_entry_size(); I != N; ++I) { const SLocEntry &SLoc = getLoadedSLocEntry(I); - if (SLoc.isFile() && + if (SLoc.isFile() && SLoc.getFile().getContentCache() && SLoc.getFile().getContentCache()->OrigEntry == SourceFile) { FirstFID = FileID::get(-int(I) - 2); @@ -1681,7 +1681,7 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { } // If we haven't found what we want yet, try again, but this time stat() - // each of the files in case the files have changed since we originally + // each of the files in case the files have changed since we originally // parsed the file. if (FirstFID.isInvalid() && (SourceFileName || @@ -1694,13 +1694,13 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { const SLocEntry &SLoc = getSLocEntry(IFileID, &Invalid); if (Invalid) return FileID(); - - if (SLoc.isFile()) { - const ContentCache *FileContentCache + + if (SLoc.isFile()) { + const ContentCache *FileContentCache = SLoc.getFile().getContentCache(); const FileEntry *Entry = FileContentCache ? FileContentCache->OrigEntry : nullptr; - if (Entry && + if (Entry && *SourceFileName == llvm::sys::path::filename(Entry->getName())) { if (Optional<llvm::sys::fs::UniqueID> EntryUID = getActualFileUID(Entry)) { @@ -1712,9 +1712,9 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { } } } - } + } } - + (void) SourceFile; return FirstFID; } @@ -1948,7 +1948,7 @@ SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { assert(!MacroArgsCache->empty()); MacroArgsMap::iterator I = MacroArgsCache->upper_bound(Offset); --I; - + unsigned MacroArgBeginOffs = I->first; SourceLocation MacroArgExpandedLoc = I->second; if (MacroArgExpandedLoc.isValid()) @@ -2151,7 +2151,7 @@ void SourceManager::PrintStats() const { << " loaded SLocEntries allocated, " << MaxLoadedOffset - CurrentLoadedOffset << "B of Sloc address space used.\n"; - + unsigned NumLineNumsComputed = 0; unsigned NumFileBytesMapped = 0; for (fileinfo_iterator I = fileinfo_begin(), E = fileinfo_end(); I != E; ++I){ @@ -2231,7 +2231,7 @@ ExternalSLocEntrySource::~ExternalSLocEntrySource() = default; SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const { size_t malloc_bytes = 0; size_t mmap_bytes = 0; - + for (unsigned i = 0, e = MemBufferInfos.size(); i != e; ++i) if (size_t sized_mapped = MemBufferInfos[i]->getSizeBytesMapped()) switch (MemBufferInfos[i]->getMemoryBufferKind()) { @@ -2242,7 +2242,7 @@ SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const { malloc_bytes += sized_mapped; break; } - + return MemoryBufferSizes(malloc_bytes, mmap_bytes); } @@ -2252,7 +2252,7 @@ size_t SourceManager::getDataStructureSizes() const { + llvm::capacity_in_bytes(LoadedSLocEntryTable) + llvm::capacity_in_bytes(SLocEntryLoaded) + llvm::capacity_in_bytes(FileInfos); - + if (OverriddenFilesInfo) size += llvm::capacity_in_bytes(OverriddenFilesInfo->OverriddenFiles); diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp index 7ae0696ce7e..e295cff9d5d 100644 --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -1757,7 +1757,7 @@ void X86TargetInfo::fillValidCPUList(SmallVectorImpl<StringRef> &Values) const { #define PROC(ENUM, STRING, IS64BIT) \ if (IS64BIT || getTriple().getArch() == llvm::Triple::x86) \ Values.emplace_back(STRING); - // Go through CPUKind checking to ensure that the alias is de-aliased and + // Go through CPUKind checking to ensure that the alias is de-aliased and // 64 bit-ness is checked. #define PROC_ALIAS(ENUM, ALIAS) \ if (checkCPUKind(getCPUKind(ALIAS))) \ diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h index b6cb27977b6..019bc8d51a6 100644 --- a/clang/lib/Basic/Targets/X86.h +++ b/clang/lib/Basic/Targets/X86.h @@ -132,7 +132,7 @@ public: : TargetInfo(Triple) { LongDoubleFormat = &llvm::APFloat::x87DoubleExtended(); } - + unsigned getFloatEvalMethod() const override { // X87 evaluates with 80 bits "long double" precision. return SSELevel == NoSSE ? 2 : 0; @@ -238,7 +238,7 @@ public: void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override; - + static void setSSELevel(llvm::StringMap<bool> &Features, X86SSEEnum Level, bool Enabled); @@ -577,7 +577,7 @@ public: IntPtrType = SignedLong; PtrDiffType = SignedLong; } - + void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { X86_32TargetInfo::getTargetDefines(Opts, Builder); @@ -664,7 +664,7 @@ public: bool hasInt128Type() const override { return true; } unsigned getUnwindWordWidth() const override { return 64; } - + unsigned getRegisterWidth() const override { return 64; } bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, diff --git a/clang/lib/Basic/Warnings.cpp b/clang/lib/Basic/Warnings.cpp index 6306ceabc63..a999c45a0c3 100644 --- a/clang/lib/Basic/Warnings.cpp +++ b/clang/lib/Basic/Warnings.cpp @@ -51,7 +51,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, Diags.setElideType(Opts.ElideType); Diags.setPrintTemplateTree(Opts.ShowTemplateTree); Diags.setShowColors(Opts.ShowColors); - + // Handle -ferror-limit if (Opts.ErrorLimit) Diags.setErrorLimit(Opts.ErrorLimit); @@ -75,7 +75,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, Diags.getDiagnosticIDs(); // We parse the warning options twice. The first pass sets diagnostic state, // while the second pass reports warnings/errors. This has the effect that - // we follow the more canonical "last option wins" paradigm when there are + // we follow the more canonical "last option wins" paradigm when there are // conflicting options. for (unsigned Report = 0, ReportEnd = 2; Report != ReportEnd; ++Report) { bool SetDiagnostic = (Report == 0); @@ -114,7 +114,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, Diags.setSuppressSystemWarnings(!isPositive); continue; } - + // -Weverything is a special case as well. It implicitly enables all // warnings, including ones not explicitly in a warning group. if (Opt == "everything") { @@ -128,8 +128,8 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, } continue; } - - // -Werror/-Wno-error is a special case, not controlled by the option + + // -Werror/-Wno-error is a special case, not controlled by the option // table. It also has the "specifier" form of -Werror=foo and -Werror-foo. if (Opt.startswith("error")) { StringRef Specifier; @@ -142,13 +142,13 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, } Specifier = Opt.substr(6); } - + if (Specifier.empty()) { if (SetDiagnostic) Diags.setWarningsAsErrors(isPositive); continue; } - + if (SetDiagnostic) { // Set the warning as error flag for this specifier. Diags.setDiagnosticGroupWarningAsError(Specifier, isPositive); @@ -157,7 +157,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, } continue; } - + // -Wfatal-errors is yet another special case. if (Opt.startswith("fatal-errors")) { StringRef Specifier; @@ -176,7 +176,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, Diags.setErrorsAsFatal(isPositive); continue; } - + if (SetDiagnostic) { // Set the error as fatal flag for this specifier. Diags.setDiagnosticGroupErrorAsFatal(Specifier, isPositive); @@ -185,7 +185,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, } continue; } - + if (Report) { if (DiagIDs->getDiagnosticsInGroup(Flavor, Opt, _Diags)) EmitUnknownDiagWarning(Diags, Flavor, isPositive ? "-W" : "-Wno-", |