aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-01-17 06:56:22 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-01-17 06:56:22 +0000
commit7530c034c0c71a64c5a9173206d9742ae847af8b (patch)
tree761f6552c7bbb066813ae21d135bd02e550090aa /lib/Lex
parent561d3abc881033776ece385a01a510e1cbc1fa92 (diff)
Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/HeaderSearch.cpp2
-rw-r--r--lib/Lex/ModuleMap.cpp2
-rw-r--r--lib/Lex/PPDirectives.cpp1
-rw-r--r--lib/Lex/PPExpressions.cpp2
-rw-r--r--lib/Lex/PreprocessingRecord.cpp1
-rw-r--r--lib/Lex/TokenConcatenation.cpp2
6 files changed, 0 insertions, 10 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 6d2d72fc22..7af7c93b7b 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -799,8 +799,6 @@ bool HeaderSearch::hasModuleMap(StringRef FileName,
// having module maps if we eventually do find a module map.
FixUpDirectories.push_back(Dir);
} while (true);
-
- return false;
}
Module *HeaderSearch::findModuleForHeader(const FileEntry *File) {
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index 745ebc4d8b..08a1e23d10 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -1263,8 +1263,6 @@ bool ModuleMapParser::parseModuleMapFile() {
break;
}
} while (true);
-
- return HadError;
}
bool ModuleMap::parseModuleMapFile(const FileEntry *File) {
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 4379b6bad1..76955604b0 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -1370,7 +1370,6 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
default:
llvm_unreachable("unknown include directive kind");
- break;
}
// Determine whether we are actually building the module that this
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 20f624a0bb..4ce48e003c 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/lib/Lex/PPExpressions.cpp
@@ -703,8 +703,6 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec,
LHS.Val = Res;
LHS.setEnd(RHS.getRange().getEnd());
}
-
- return false;
}
/// EvaluateDirectiveExpression - Evaluate an integer constant expression that
diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp
index 770a69d19b..6c36e73ad3 100644
--- a/lib/Lex/PreprocessingRecord.cpp
+++ b/lib/Lex/PreprocessingRecord.cpp
@@ -390,7 +390,6 @@ void PreprocessingRecord::InclusionDirective(
default:
llvm_unreachable("Unknown include directive kind");
- return;
}
clang::InclusionDirective *ID
diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp
index dc6d686d6c..335d864f3f 100644
--- a/lib/Lex/TokenConcatenation.cpp
+++ b/lib/Lex/TokenConcatenation.cpp
@@ -179,11 +179,9 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
switch (PrevKind) {
default:
llvm_unreachable("InitAvoidConcatTokenInfo built wrong");
- return true;
case tok::raw_identifier:
llvm_unreachable("tok::raw_identifier in non-raw lexing mode!");
- return true;
case tok::identifier: // id+id or id+number or id+L"foo".
// id+'.'... will not append.