Commit 9b000b7b authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.4'

Change-Id: Ia013f44f432d9c4dcc2e9626b9b3c9d7fa84b623
parents f3e1b6bb 1f04804e
diff --git a/tools/clang/lib/Sema/SemaDecl.cpp b/tools/clang/lib/Sema/SemaDecl.cpp
index 41719d4e7b..747a4cc0c5 100644
--- a/tools/clang/lib/Sema/SemaDecl.cpp
+++ b/tools/clang/lib/Sema/SemaDecl.cpp
@@ -13112,7 +13112,14 @@ CreateNewDecl:
OwnedDecl = true;
// In C++, don't return an invalid declaration. We can't recover well from
// the cases where we make the type anonymous.
- return (Invalid && getLangOpts().CPlusPlus) ? nullptr : New;
+ if (Invalid && getLangOpts().CPlusPlus) {
+ if (New->isBeingDefined())
+ if (auto RD = dyn_cast<RecordDecl>(New))
+ RD->completeDefinition();
+ return nullptr;
+ } else {
+ return New;
+ }
}
void Sema::ActOnTagStartDefinition(Scope *S, Decl *TagD) {
diff --git a/tools/clang/test/SemaCXX/conversion-function.cpp b/tools/clang/test/SemaCXX/conversion-function.cpp
index 3f494cce8c..c725a0d5b7 100644
--- a/tools/clang/test/SemaCXX/conversion-function.cpp
+++ b/tools/clang/test/SemaCXX/conversion-function.cpp
@@ -434,8 +434,12 @@ namespace PR18234 {
struct A {
operator enum E { e } (); // expected-error {{'PR18234::A::E' cannot be defined in a type specifier}}
operator struct S { int n; } (); // expected-error {{'PR18234::A::S' cannot be defined in a type specifier}}
+ // expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const PR18234::A::S &' for 1st argument}}
+#if __cplusplus >= 201103L
+ // expected-note@-3 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'PR18234::A::S &&' for 1st argument}}
+#endif
} a;
- A::S s = a;
+ A::S s = a; // expected-error {{no viable conversion from 'struct A' to 'A::S'}}
A::E e = a; // expected-note {{here}}
bool k1 = e == A::e; // expected-error {{no member named 'e'}}
bool k2 = e.n == 0;
diff --git a/tools/clang/lib/Basic/FileManager.cpp b/tools/clang/lib/Basic/FileManager.cpp
index 50050d0..3f79493 100644
index ce9b7e1bb4..6cfe1f6ebd 100644
--- a/tools/clang/lib/Basic/FileManager.cpp
+++ b/tools/clang/lib/Basic/FileManager.cpp
@@ -386,6 +386,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size,
@@ -383,6 +383,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size,
UFE->ModTime = ModificationTime;
UFE->Dir = DirInfo;
UFE->UID = NextFileUID++;
......
diff --git a/tools/clang/lib/Frontend/ASTUnit.cpp b/tools/clang/lib/Frontend/ASTUnit.cpp
index d892996..5148a8b 100644
--- a/tools/clang/lib/Frontend/ASTUnit.cpp
+++ b/tools/clang/lib/Frontend/ASTUnit.cpp
@@ -2534,6 +2534,8 @@ void ASTUnit::TranslateStoredDiagnostics(
SmallVector<StoredDiagnostic, 4> Result;
Result.reserve(Diags.size());
+ const FileEntry *PreviousFE = nullptr;
+ FileID FID;
for (const StandaloneDiagnostic &SD : Diags) {
// Rebuild the StoredDiagnostic.
if (SD.Filename.empty())
@@ -2541,7 +2543,10 @@ void ASTUnit::TranslateStoredDiagnostics(
const FileEntry *FE = FileMgr.getFile(SD.Filename);
if (!FE)
continue;
- FileID FID = SrcMgr.translateFile(FE);
+ if (FE != PreviousFE) {
+ FID = SrcMgr.translateFile(FE);
+ PreviousFE = FE;
+ }
SourceLocation FileLoc = SrcMgr.getLocForStartOfFile(FID);
if (FileLoc.isInvalid())
continue;
diff --git a/tools/clang/lib/Sema/SemaCodeComplete.cpp b/tools/clang/lib/Sema/SemaCodeComplete.cpp
index f4b51a19c2..f4b35fd408 100644
--- a/tools/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/tools/clang/lib/Sema/SemaCodeComplete.cpp
@@ -4066,7 +4066,10 @@ void Sema::CodeCompleteCall(Scope *S, Expr *Fn, ArrayRef<Expr *> Args) {
UME->copyTemplateArgumentsInto(TemplateArgsBuffer);
TemplateArgs = &TemplateArgsBuffer;
}
- SmallVector<Expr *, 12> ArgExprs(1, UME->getBase());
+
+ // Add the base as first argument (use a nullptr if the base is implicit).
+ SmallVector<Expr *, 12> ArgExprs(
+ 1, UME->isImplicitAccess() ? nullptr : UME->getBase());
ArgExprs.append(Args.begin(), Args.end());
UnresolvedSet<8> Decls;
Decls.append(UME->decls_begin(), UME->decls_end());
diff --git a/tools/clang/lib/Sema/SemaOverload.cpp b/tools/clang/lib/Sema/SemaOverload.cpp
index 40d6e910f1..19547237ac 100644
--- a/tools/clang/lib/Sema/SemaOverload.cpp
+++ b/tools/clang/lib/Sema/SemaOverload.cpp
@@ -6051,31 +6051,44 @@ void Sema::AddFunctionCandidates(const UnresolvedSetImpl &Fns,
for (UnresolvedSetIterator F = Fns.begin(), E = Fns.end(); F != E; ++F) {
NamedDecl *D = F.getDecl()->getUnderlyingDecl();
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- if (isa<CXXMethodDecl>(FD) && !cast<CXXMethodDecl>(FD)->isStatic())
+ if (isa<CXXMethodDecl>(FD) && !cast<CXXMethodDecl>(FD)->isStatic()) {
+ QualType ObjectType;
+ Expr::Classification ObjectClassification;
+ if (Expr *E = Args[0]) {
+ // Use the explit base to restrict the lookup:
+ ObjectType = E->getType();
+ ObjectClassification = E->Classify(Context);
+ } // .. else there is an implit base.
AddMethodCandidate(cast<CXXMethodDecl>(FD), F.getPair(),
- cast<CXXMethodDecl>(FD)->getParent(),
- Args[0]->getType(), Args[0]->Classify(Context),
- Args.slice(1), CandidateSet,
+ cast<CXXMethodDecl>(FD)->getParent(), ObjectType,
+ ObjectClassification, Args.slice(1), CandidateSet,
SuppressUserConversions, PartialOverloading);
- else
+ } else {
AddOverloadCandidate(FD, F.getPair(), Args, CandidateSet,
SuppressUserConversions, PartialOverloading);
+ }
} else {
FunctionTemplateDecl *FunTmpl = cast<FunctionTemplateDecl>(D);
if (isa<CXXMethodDecl>(FunTmpl->getTemplatedDecl()) &&
- !cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl())->isStatic())
+ !cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl())->isStatic()) {
+ QualType ObjectType;
+ Expr::Classification ObjectClassification;
+ if (Expr *E = Args[0]) {
+ // Use the explit base to restrict the lookup:
+ ObjectType = E->getType();
+ ObjectClassification = E->Classify(Context);
+ } // .. else there is an implit base.
AddMethodTemplateCandidate(FunTmpl, F.getPair(),
- cast<CXXRecordDecl>(FunTmpl->getDeclContext()),
- ExplicitTemplateArgs,
- Args[0]->getType(),
- Args[0]->Classify(Context), Args.slice(1),
- CandidateSet, SuppressUserConversions,
+ cast<CXXRecordDecl>(FunTmpl->getDeclContext()),
+ ExplicitTemplateArgs, ObjectType, ObjectClassification,
+ Args.slice(1), CandidateSet, SuppressUserConversions,
PartialOverloading);
- else
+ } else {
AddTemplateOverloadCandidate(FunTmpl, F.getPair(),
ExplicitTemplateArgs, Args,
CandidateSet, SuppressUserConversions,
PartialOverloading);
+ }
}
}
}
diff --git a/tools/clang/test/CodeCompletion/member-access.cpp b/tools/clang/test/CodeCompletion/member-access.cpp
index 8f772c0652..8528e18649 100644
--- a/tools/clang/test/CodeCompletion/member-access.cpp
+++ b/tools/clang/test/CodeCompletion/member-access.cpp
@@ -27,16 +27,31 @@ public:
void test(const Proxy &p) {
p->
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
- // CHECK-CC1: Base1 : Base1::
- // CHECK-CC1: member1 : [#int#][#Base1::#]member1
- // CHECK-CC1: member1 : [#int#][#Base2::#]member1
- // CHECK-CC1: member2 : [#float#][#Base1::#]member2
- // CHECK-CC1: member3
- // CHECK-CC1: member4
- // CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#float#>)
- // CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#double#>)[# const#]
- // CHECK-CC1: memfun1 (Hidden) : [#void#]Base2::memfun1(<#int#>)
- // CHECK-CC1: memfun2 : [#void#][#Base3::#]memfun2(<#int#>)
- // CHECK-CC1: memfun3 : [#int#]memfun3(<#int#>)
-
+}
+
+struct Foo {
+ void foo() const;
+ static void foo(bool);
+};
+
+struct Bar {
+ void foo(bool param) {
+ Foo::foo( );// unresolved member expression with an implicit base
+ }
+};
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: Base1 : Base1::
+// CHECK-CC1: member1 : [#int#][#Base1::#]member1
+// CHECK-CC1: member1 : [#int#][#Base2::#]member1
+// CHECK-CC1: member2 : [#float#][#Base1::#]member2
+// CHECK-CC1: member3
+// CHECK-CC1: member4
+// CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#float#>)
+// CHECK-CC1: memfun1 : [#void#][#Base3::#]memfun1(<#double#>)[# const#]
+// CHECK-CC1: memfun1 (Hidden) : [#void#]Base2::memfun1(<#int#>)
+// CHECK-CC1: memfun2 : [#void#][#Base3::#]memfun2(<#int#>)
+// CHECK-CC1: memfun3 : [#int#]memfun3(<#int#>)
+
+// Make sure this also doesn't crash
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:39:14 %s
diff --git a/tools/clang/include/clang-c/Index.h b/tools/clang/include/clang-c/Index.h
index 13db2085ba..eb6a5f14b2 100644
--- a/tools/clang/include/clang-c/Index.h
+++ b/tools/clang/include/clang-c/Index.h
@@ -33,6 +33,7 @@
*/
#define CINDEX_VERSION_MAJOR 0
#define CINDEX_VERSION_MINOR 35
+#define CINDEX_VERSION_HAS_BACKPORTED_SUSPEND
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -1404,6 +1405,15 @@ CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU,
unsigned options);
/**
+ * \brief Suspend a translation unit in order to free memory associated with it.
+ *
+ * A suspended translation unit uses significantly less memory but on the other
+ * side does not support any other calls than \c clang_reparseTranslationUnit
+ * to resume it or \c clang_disposeTranslationUnit to dispose it completely.
+ */
+CINDEX_LINKAGE unsigned clang_suspendTranslationUnit(CXTranslationUnit);
+
+/**
* \brief Destroy the specified CXTranslationUnit object.
*/
CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit);
diff --git a/tools/clang/include/clang/Frontend/ASTUnit.h b/tools/clang/include/clang/Frontend/ASTUnit.h
index 3eaf054139..3745ec690e 100644
--- a/tools/clang/include/clang/Frontend/ASTUnit.h
+++ b/tools/clang/include/clang/Frontend/ASTUnit.h
@@ -870,6 +870,11 @@ public:
bool Reparse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
ArrayRef<RemappedFile> RemappedFiles = None);
+ /// \brief Free data that will be re-generated on the next parse.
+ ///
+ /// Preamble-related data is not affected.
+ void ResetForParse();
+
/// \brief Perform code completion at the given file, line, and
/// column within this translation unit.
///
diff --git a/tools/clang/lib/Frontend/ASTUnit.cpp b/tools/clang/lib/Frontend/ASTUnit.cpp
index b446b53fa4..96437e15bb 100644
--- a/tools/clang/lib/Frontend/ASTUnit.cpp
+++ b/tools/clang/lib/Frontend/ASTUnit.cpp
@@ -1034,8 +1034,6 @@ static void checkAndSanitizeDiags(SmallVectorImpl<StoredDiagnostic> &
/// contain any translation-unit information, false otherwise.
bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
std::unique_ptr<llvm::MemoryBuffer> OverrideMainBuffer) {
- SavedMainFileBuffer.reset();
-
if (!Invocation)
return true;
@@ -1083,16 +1081,12 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
Clang->createFileManager();
FileMgr = &Clang->getFileManager();
}
+
+ ResetForParse();
+
SourceMgr = new SourceManager(getDiagnostics(), *FileMgr,
UserFilesAreVolatile);
- TheSema.reset();
- Ctx = nullptr;
- PP = nullptr;
- Reader = nullptr;
- // Clear out old caches and data.
- TopLevelDecls.clear();
- clearFileLevelDecls();
CleanTemporaryFiles();
if (!OverrideMainBuffer) {
@@ -2082,6 +2076,19 @@ bool ASTUnit::Reparse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
return Result;
}
+void ASTUnit::ResetForParse() {
+ SavedMainFileBuffer.reset();
+
+ SourceMgr.reset();
+ TheSema.reset();
+ Ctx.reset();
+ PP.reset();
+ Reader.reset();
+
+ TopLevelDecls.clear();
+ clearFileLevelDecls();
+}
+
//----------------------------------------------------------------------------//
// Code completion
//----------------------------------------------------------------------------//
diff --git a/tools/clang/tools/c-index-test/c-index-test.c b/tools/clang/tools/c-index-test/c-index-test.c
index 007af9e252..c40bdb888d 100644
--- a/tools/clang/tools/c-index-test/c-index-test.c
+++ b/tools/clang/tools/c-index-test/c-index-test.c
@@ -1664,6 +1664,8 @@ int perform_test_load_source(int argc, const char **argv,
return -1;
if (Repeats > 1) {
+ clang_suspendTranslationUnit(TU);
+
Err = clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
clang_defaultReparseOptions(TU));
if (Err != CXError_Success) {
diff --git a/tools/clang/tools/libclang/CIndex.cpp b/tools/clang/tools/libclang/CIndex.cpp
index deb4cc551b..81cb5c3778 100644
--- a/tools/clang/tools/libclang/CIndex.cpp
+++ b/tools/clang/tools/libclang/CIndex.cpp
@@ -3778,6 +3778,20 @@ void clang_disposeTranslationUnit(CXTranslationUnit CTUnit) {
}
}
+unsigned clang_suspendTranslationUnit(CXTranslationUnit CTUnit) {
+ if (CTUnit) {
+ ASTUnit *Unit = cxtu::getASTUnit(CTUnit);
+
+ if (Unit && Unit->isUnsafeToFree())
+ return false;
+
+ Unit->ResetForParse();
+ return true;
+ }
+
+ return false;
+}
+
unsigned clang_defaultReparseOptions(CXTranslationUnit TU) {
return CXReparse_None;
}
diff --git a/tools/clang/tools/libclang/libclang.exports b/tools/clang/tools/libclang/libclang.exports
index c8fe0a21d0..7a8f53d394 100644
--- a/tools/clang/tools/libclang/libclang.exports
+++ b/tools/clang/tools/libclang/libclang.exports
@@ -298,6 +298,7 @@ clang_remap_getFilenames
clang_remap_getNumFiles
clang_reparseTranslationUnit
clang_saveTranslationUnit
+clang_suspendTranslationUnit
clang_sortCodeCompletionResults
clang_toggleCrashRecovery
clang_tokenize
diff --git a/tools/clang/include/clang/Frontend/ASTUnit.h b/tools/clang/include/clang/Frontend/ASTUnit.h
index 04e6dce511..3eaf054139 100644
--- a/tools/clang/include/clang/Frontend/ASTUnit.h
+++ b/tools/clang/include/clang/Frontend/ASTUnit.h
@@ -184,6 +184,14 @@ private:
/// some number of calls.
unsigned PreambleRebuildCounter;
+ /// \brief Cache pairs "filename - source location"
+ ///
+ /// Cache contains only source locations from preamble so it is
+ /// guaranteed that they stay valid when the SourceManager is recreated.
+ /// This cache is used when loading preambule to increase performance
+ /// of that loading. It must be cleared when preamble is recreated.
+ llvm::StringMap<SourceLocation> PreambleSrcLocCache;
+
public:
class PreambleData {
const FileEntry *File;
diff --git a/tools/clang/lib/Frontend/ASTUnit.cpp b/tools/clang/lib/Frontend/ASTUnit.cpp
index 76fd00a132..c1c2680dcd 100644
--- a/tools/clang/lib/Frontend/ASTUnit.cpp
+++ b/tools/clang/lib/Frontend/ASTUnit.cpp
@@ -1142,6 +1142,8 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
if (SavedMainFileBuffer)
TranslateStoredDiagnostics(getFileManager(), getSourceManager(),
PreambleDiagnostics, StoredDiagnostics);
+ else
+ PreambleSrcLocCache.clear();
if (!Act->Execute())
goto error;
@@ -2544,8 +2546,16 @@ void ASTUnit::TranslateStoredDiagnostics(
const FileEntry *FE = FileMgr.getFile(SD.Filename);
if (!FE)
continue;
- FileID FID = SrcMgr.translateFile(FE);
- SourceLocation FileLoc = SrcMgr.getLocForStartOfFile(FID);
+ SourceLocation FileLoc;
+ auto ItFileID = PreambleSrcLocCache.find(SD.Filename);
+ if (ItFileID == PreambleSrcLocCache.end()) {
+ FileID FID = SrcMgr.translateFile(FE);
+ FileLoc = SrcMgr.getLocForStartOfFile(FID);
+ PreambleSrcLocCache[SD.Filename] = FileLoc;
+ } else {
+ FileLoc = ItFileID->getValue();
+ }
+
if (FileLoc.isInvalid())
continue;
SourceLocation L = FileLoc.getLocWithOffset(SD.LocOffset);
diff --git a/tools/clang/include/clang/Lex/Preprocessor.h b/tools/clang/include/clang/Lex/Preprocessor.h
index 3d1d9a86e0..0a02c977fc 100644
--- a/tools/clang/include/clang/Lex/Preprocessor.h
+++ b/tools/clang/include/clang/Lex/Preprocessor.h
@@ -1034,6 +1034,8 @@ public:
/// which implicitly adds the builtin defines etc.
void EnterMainSourceFile();
+ void replayPreambleConditionalStack();
+
/// \brief Inform the preprocessor callbacks that processing is complete.
void EndSourceFile();
@@ -1700,11 +1702,6 @@ public:
/// \brief Return true if we're in the top-level file, not in a \#include.
bool isInPrimaryFile() const;
- /// \brief Return true if we're in the main file (specifically, if we are 0
- /// (zero) levels deep \#include. This is used by the lexer to determine if
- /// it needs to generate errors about unterminated \#if directives.
- bool isInMainFile() const;
-
/// \brief Handle cases where the \#include name is expanded
/// from a macro as multiple tokens, which need to be glued together.
///
diff --git a/tools/clang/lib/Lex/Lexer.cpp b/tools/clang/lib/Lex/Lexer.cpp
index 72f7011d4f..5953412608 100644
--- a/tools/clang/lib/Lex/Lexer.cpp
+++ b/tools/clang/lib/Lex/Lexer.cpp
@@ -2506,7 +2506,7 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) {
return true;
}
- if (PP->isRecordingPreamble() && !PP->isInMainFile()) {
+ if (PP->isRecordingPreamble() && PP->isInPrimaryFile()) {
PP->setRecordedPreambleConditionalStack(ConditionalStack);
ConditionalStack.clear();
}
diff --git a/tools/clang/lib/Lex/PPLexerChange.cpp b/tools/clang/lib/Lex/PPLexerChange.cpp
index 849a703671..e2eceafd98 100644
--- a/tools/clang/lib/Lex/PPLexerChange.cpp
+++ b/tools/clang/lib/Lex/PPLexerChange.cpp
@@ -46,12 +46,6 @@ bool Preprocessor::isInPrimaryFile() const {
return true;
}
-bool Preprocessor::isInMainFile() const {
- if (IsFileLexer())
- return IncludeMacroStack.size() == 0;
- return true;
-}
-
/// getCurrentLexer - Return the current file lexer being lexed from. Note
/// that this ignores any potentially active macro expansions and _Pragma
/// expansions going on at the time.
diff --git a/tools/clang/lib/Lex/Preprocessor.cpp b/tools/clang/lib/Lex/Preprocessor.cpp
index 1da60961a8..bb67b9c77a 100644
--- a/tools/clang/lib/Lex/Preprocessor.cpp
+++ b/tools/clang/lib/Lex/Preprocessor.cpp
@@ -531,7 +531,9 @@ void Preprocessor::EnterMainSourceFile() {
// Start parsing the predefines.
EnterSourceFile(FID, nullptr, SourceLocation());
+}
+void Preprocessor::replayPreambleConditionalStack() {
// Restore the conditional stack from the preamble, if there is one.
if (PreambleConditionalStack.isReplaying()) {
CurPPLexer->setConditionalLevels(PreambleConditionalStack.getStack());
diff --git a/tools/clang/lib/Parse/Parser.cpp b/tools/clang/lib/Parse/Parser.cpp
index f968f995d5..45662e7866 100644
--- a/tools/clang/lib/Parse/Parser.cpp
+++ b/tools/clang/lib/Parse/Parser.cpp
@@ -528,6 +528,8 @@ void Parser::Initialize() {
// Prime the lexer look-ahead.
ConsumeToken();
+
+ PP.replayPreambleConditionalStack();
}
void Parser::LateTemplateParserCleanupCallback(void *P) {
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index b935cbf1ae7..3c9a25062f5 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -286,6 +286,11 @@ static bool shouldUseMmap(int FD,
bool RequiresNullTerminator,
int PageSize,
bool IsVolatileSize) {
+#ifdef _WIN32
+ // Do not use mmap on Windows in order to avoid file locking
+ return false;
+#endif
+
// mmap may leave the buffer without null terminator if the file size changed
// by the time the last page is mapped in, so avoid it if the file size is
// likely to change.
diff --git a/utils/TableGen/CMakeLists.txt b/utils/TableGen/CMakeLists.txt
index 604e3f1..4e5874c 100644
--- a/utils/TableGen/CMakeLists.txt
+++ b/utils/TableGen/CMakeLists.txt
@@ -1,4 +1,7 @@
set(LLVM_LINK_COMPONENTS Support)
+if (MINGW)
+ set(CMAKE_BUILD_TYPE "Debug")
+endif()
add_tablegen(llvm-tblgen LLVM
AsmMatcherEmitter.cpp
......@@ -128,6 +128,26 @@
If the current device state is \uicontrol Connected, (the traffic light icon is
orange), you need to configure the device using Xcode.
\section1 Specifying Supported iOS Versions
Qt 5 applications can be built for the latest iOS version and deployed to
previous versions. For the most part, this works automatically. However,
you must take care when you manually set your own target version. If you set
it to a value higher than what Qt requires and supply your own \c Info.plist
file, you must add an \c LSMinimumSystemVersion entry to the \c Info.plist
that matches the value of \c QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake)
or \c cpp.minimumIosVersion (when using Qbs), because iOS (and the
App Store) will use the \c LSMinimumSystemVersion value as the authoritative
one.
If you specify a deployment target value lower than what Qt requires, your
application will almost certainly crash somewhere in the Qt libraries when
run on an older version than Qt supports. Therefore, make sure that the
actual build system code reflects the minimum iOS version that is actually
required.
For more information, see \l{Expressing Supported iOS Versions}.
\section1 Testing on iOS Simulator
If you do not have an iOS device or you do not want to create an account,
......
......@@ -75,6 +75,13 @@
location after building them. This option is enabled by
default.
\note On Windows, the build will fail if the application
is running, because the executable file cannot be
overwritten. To avoid this issue, you can deselect this
check box and add a \uicontrol {Qbs Install} deployment step
in the run settings that will be performed just before
running the application.
\li Select \uicontrol {Clean install root} to remove the
contents of the install root directory before the build
starts.
......
......@@ -40196,7 +40196,7 @@ Applied to text, if no other rules matching.</source>
</message>
<message>
<source>Doxygen Comment</source>
<translation>Коментарий Doxygen</translation>
<translation>Комментарий Doxygen</translation>
</message>
<message>
<source>Doxygen comments.</source>
......@@ -69,7 +69,7 @@ ArtisticStyle::~ArtisticStyle()
bool ArtisticStyle::initialize()
{
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ArtisticStyle::MENU_ID);
menu->menu()->setTitle(tr(Constants::ArtisticStyle::DISPLAY_NAME));
menu->menu()->setTitle(tr("&Artistic Style"));
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
menu->addAction(Core::ActionManager::registerAction(m_formatFile,
......
......@@ -193,7 +193,7 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt
Q_UNUSED(errorString)
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
menu->menu()->setTitle(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
menu->menu()->setTitle(QCoreApplication::translate("Beautifier", "Bea&utifier"));
menu->setOnAllDisabledBehavior(Core::ActionContainer::Show);
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
return true;
......@@ -487,13 +487,13 @@ QString BeautifierPlugin::msgCannotGetConfigurationFile(const QString &command)
QString BeautifierPlugin::msgFormatCurrentFile()
{
//: Menu entry
return tr("Format Current File");
return tr("Format &Current File");
}
QString BeautifierPlugin::msgFormatSelectedText()
{
//: Menu entry
return tr("Format Selected Text");
return tr("Format &Selected Text");
}
QString BeautifierPlugin::msgCommandPromptDialogTitle(const QString &command)
......
......@@ -73,7 +73,7 @@ QString ClangFormat::id() const
bool ClangFormat::initialize()
{
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ClangFormat::MENU_ID);
menu->menu()->setTitle(tr(Constants::ClangFormat::DISPLAY_NAME));
menu->menu()->setTitle(tr("&ClangFormat"));
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
Core::Command *cmd
......
......@@ -69,7 +69,7 @@ Uncrustify::~Uncrustify()
bool Uncrustify::initialize()
{
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::Uncrustify::MENU_ID);
menu->menu()->setTitle(tr(Constants::Uncrustify::DISPLAY_NAME));
menu->menu()->setTitle(tr("&Uncrustify"));
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
Core::Command *cmd
......
......@@ -194,7 +194,6 @@ void CppEditorWidget::finalizeInitialization()
connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished, this,
[this] (SemanticInfo::LocalUseMap localUses) {
QTC_CHECK(isSemanticInfoValidExceptLocalUses());
d->m_lastSemanticInfo.localUsesUpdated = true;
d->m_lastSemanticInfo.localUses = localUses;
});
......
......@@ -683,21 +683,20 @@ SavedAction *DebuggerSettings::item(int code) const
QString DebuggerSettings::dump() const
{
QString out;
QTextStream ts(&out);
ts << "Debugger settings: ";
QStringList settings;
foreach (SavedAction *item, m_items) {
QString key = item->settingsKey();
if (!key.isEmpty()) {
const QString current = item->value().toString();
const QString default_ = item->defaultValue().toString();
ts << '\n' << key << ": " << current
<< " (default: " << default_ << ')';
QString setting = key + ": " + current + " (default: " + default_ + ')';
if (current != default_)
ts << " ***";
setting += " ***";
settings << setting;
}
}
return out;
settings.sort();
return "Debugger settings:\n" + settings.join('\n');
}
} // namespace Internal
......
......@@ -2943,8 +2943,8 @@ static QString formatStartParameters(DebuggerRunParameters &sp)
if (sp.attachPID.isValid())
str << "PID: " << sp.attachPID.pid() << ' ' << sp.crashParameter << '\n';
if (!sp.projectSourceDirectory.isEmpty()) {
str << "Project: " << QDir::toNativeSeparators(sp.projectSourceDirectory);
str << "Addtional Search Directories:"
str << "Project: " << QDir::toNativeSeparators(sp.projectSourceDirectory) << '\n';
str << "Additional Search Directories:"
<< sp.additionalSearchDirectories.join(QLatin1Char(' ')) << '\n';
}
if (!sp.remoteChannel.isEmpty())
......@@ -2961,7 +2961,7 @@ void DebuggerPluginPrivate::runControlStarted(DebuggerRunTool *runTool)
{
activateDebugMode();
const QString message = tr("Starting debugger \"%1\" for ABI \"%2\"...")
.arg(runTool->objectName())
.arg(runTool->engine()->objectName())
.arg(runTool->runParameters().toolChainAbi.toString());
showStatusMessage(message);
showMessage(formatStartParameters(runTool->runParameters()), LogDebug);
......
......@@ -281,11 +281,12 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
QTC_ASSERT(kit, return false);
// Extract as much as possible from available RunConfiguration.
if (runConfig->runnable().is<StandardRunnable>()) {
const Runnable runnable = runConfig->runnable();
if (runnable.is<StandardRunnable>()) {
// FIXME: Needed for core dump which stores the executable in inferior, but not in runConfig