summaryrefslogtreecommitdiffstats
path: root/lib/Frontend
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-14 09:24:02 +0000
committered <ed@FreeBSD.org>2009-06-14 09:24:02 +0000
commitb8e7410b22fa573fb0078712439f343bc69208dd (patch)
treed472a7615b5c7e413aa62a77d0777c1a9cf76478 /lib/Frontend
parent6514d87c1aa5b544d02c3822fe41217e2051673d (diff)
downloadFreeBSD-src-b8e7410b22fa573fb0078712439f343bc69208dd.zip
FreeBSD-src-b8e7410b22fa573fb0078712439f343bc69208dd.tar.gz
Import Clang r73340.
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/Backend.cpp8
-rw-r--r--lib/Frontend/PCHReaderStmt.cpp1
-rw-r--r--lib/Frontend/PCHWriterStmt.cpp2
-rw-r--r--lib/Frontend/PrintParserCallbacks.cpp7
4 files changed, 13 insertions, 5 deletions
diff --git a/lib/Frontend/Backend.cpp b/lib/Frontend/Backend.cpp
index 9560b61..d8f8625 100644
--- a/lib/Frontend/Backend.cpp
+++ b/lib/Frontend/Backend.cpp
@@ -272,9 +272,13 @@ void BackendConsumer::CreatePasses() {
llvm::Pass *InliningPass = 0;
switch (CompileOpts.Inlining) {
case CompileOptions::NoInlining: break;
- case CompileOptions::NormalInlining:
- InliningPass = createFunctionInliningPass(); // Inline small functions
+ case CompileOptions::NormalInlining: {
+ // Inline small functions
+ unsigned Threshold = (CompileOpts.OptimizeSize ||
+ CompileOpts.OptimizationLevel < 3) ? 50 : 200;
+ InliningPass = createFunctionInliningPass(Threshold);
break;
+ }
case CompileOptions::OnlyAlwaysInlining:
InliningPass = createAlwaysInlinerPass(); // Respect always_inline
break;
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index 10059f6..e6871e3 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -210,6 +210,7 @@ unsigned PCHStmtReader::VisitDoStmt(DoStmt *S) {
S->setBody(StmtStack.back());
S->setDoLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
S->setWhileLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ S->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
return 2;
}
diff --git a/lib/Frontend/PCHWriterStmt.cpp b/lib/Frontend/PCHWriterStmt.cpp
index b7caee5..73dea10 100644
--- a/lib/Frontend/PCHWriterStmt.cpp
+++ b/lib/Frontend/PCHWriterStmt.cpp
@@ -23,7 +23,6 @@ using namespace clang;
namespace {
class PCHStmtWriter : public StmtVisitor<PCHStmtWriter, void> {
-
PCHWriter &Writer;
PCHWriter::RecordData &Record;
@@ -197,6 +196,7 @@ void PCHStmtWriter::VisitDoStmt(DoStmt *S) {
Writer.WriteSubStmt(S->getBody());
Writer.AddSourceLocation(S->getDoLoc(), Record);
Writer.AddSourceLocation(S->getWhileLoc(), Record);
+ Writer.AddSourceLocation(S->getRParenLoc(), Record);
Code = pch::STMT_DO;
}
diff --git a/lib/Frontend/PrintParserCallbacks.cpp b/lib/Frontend/PrintParserCallbacks.cpp
index b9fe068..170ab5e 100644
--- a/lib/Frontend/PrintParserCallbacks.cpp
+++ b/lib/Frontend/PrintParserCallbacks.cpp
@@ -327,7 +327,9 @@ namespace {
return StmtEmpty();
}
virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
- SourceLocation WhileLoc, ExprArg Cond){
+ SourceLocation WhileLoc,
+ SourceLocation LPLoc, ExprArg Cond,
+ SourceLocation RPLoc){
Out << __FUNCTION__ << "\n";
return StmtEmpty();
}
@@ -701,7 +703,8 @@ namespace {
}
virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
- SourceLocation EqualLoc) {
+ SourceLocation EqualLoc,
+ SourceLocation ArgLoc) {
Out << __FUNCTION__ << "\n";
}
OpenPOWER on IntegriCloud