[cfe-commits] r38806 - in /cfe/cfe/trunk: clang.xcodeproj/project.pbxproj include/clang/Basic/LangOptions.h include/clang/Lex/Lexer.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:24:48 PDT 2007
Author: sabre
Date: Wed Jul 11 11:24:48 2007
New Revision: 38806
URL: http://llvm.org/viewvc/llvm-project?rev=38806&view=rev
Log:
Split LangOptions out into its own header
Added:
cfe/cfe/trunk/include/clang/Basic/LangOptions.h (with props)
Modified:
cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
cfe/cfe/trunk/include/clang/Lex/Lexer.h
Modified: cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=38806&r1=38805&r2=38806&view=diff
==============================================================================
--- cfe/cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/cfe/trunk/clang.xcodeproj/project.pbxproj Wed Jul 11 11:24:48 2007
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06B73D0A8307640050E87E /* LangOptions.h */; };
DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; };
DE1F22200A7D879000FBF588 /* ParserActions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F221F0A7D879000FBF588 /* ParserActions.h */; };
DE1F24700A7DC99000FBF588 /* Actions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE1F246D0A7DC99000FBF588 /* Actions.cpp */; };
@@ -96,6 +97,7 @@
DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */,
DE1F22200A7D879000FBF588 /* ParserActions.h in CopyFiles */,
DE1F24820A7DCD3800FBF588 /* Declarations.h in CopyFiles */,
+ DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
@@ -103,6 +105,7 @@
/* Begin PBXFileReference section */
8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
+ DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = "<group>"; };
DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = "<group>"; };
DE1F221F0A7D879000FBF588 /* ParserActions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParserActions.h; path = clang/Parse/ParserActions.h; sourceTree = "<group>"; };
DE1F246D0A7DC99000FBF588 /* Actions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Actions.cpp; path = Parse/Actions.cpp; sourceTree = "<group>"; };
@@ -244,6 +247,7 @@
DED7D7310A524295003AD0FB /* Diagnostic.h */,
DED7D7320A524295003AD0FB /* DiagnosticKinds.def */,
DED7D7330A524295003AD0FB /* FileManager.h */,
+ DE06B73D0A8307640050E87E /* LangOptions.h */,
DED7D7340A524295003AD0FB /* SourceBuffer.h */,
DED7D7350A524295003AD0FB /* SourceLocation.h */,
DED7D7360A524295003AD0FB /* SourceManager.h */,
Added: cfe/cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/LangOptions.h?rev=38806&view=auto
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/LangOptions.h (added)
+++ cfe/cfe/trunk/include/clang/Basic/LangOptions.h Wed Jul 11 11:24:48 2007
@@ -0,0 +1,50 @@
+//===--- LangOptions.h - C Language Family Language Options -----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the LangOptions interface.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_LANGOPTIONS_H
+#define LLVM_CLANG_LANGOPTIONS_H
+
+namespace llvm {
+namespace clang {
+
+/// LangOptions - This class keeps track of the various options that can be
+/// enabled, which controls the dialect of C that is accepted.
+struct LangOptions {
+ unsigned Trigraphs : 1; // Trigraphs in source files.
+ unsigned BCPLComment : 1; // BCPL-style // comments.
+ unsigned DollarIdents : 1; // '$' allowed in identifiers.
+ unsigned Digraphs : 1; // When added to C? C99?
+ unsigned HexFloats : 1; // C99 Hexadecimal float constants.
+ unsigned C99 : 1; // C99 Support
+ unsigned Microsoft : 1; // Microsoft extensions.
+ unsigned CPlusPlus : 1; // C++ Support
+ unsigned CPPMinMax : 1; // C++ <?=, >?= tokens.
+ unsigned NoExtensions : 1; // All extensions are disabled, strict mode.
+
+ unsigned ObjC1 : 1; // Objective C 1 support enabled.
+ unsigned ObjC2 : 1; // Objective C 2 support enabled.
+
+ unsigned KeepComments : 1; // Keep comments ("-C") mode.
+ unsigned KeepMacroComments : 1; // Keep macro-exp comments ("-CC") mode.
+
+ LangOptions() {
+ Trigraphs = BCPLComment = DollarIdents = Digraphs = ObjC1 = ObjC2 = 0;
+ C99 = Microsoft = CPlusPlus = CPPMinMax = NoExtensions = 0;
+ KeepComments = KeepMacroComments = 0;
+ }
+};
+
+} // end namespace clang
+} // end namespace llvm
+
+#endif
Propchange: cfe/cfe/trunk/include/clang/Basic/LangOptions.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/cfe/trunk/include/clang/Basic/LangOptions.h
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: cfe/cfe/trunk/include/clang/Lex/Lexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Lexer.h?rev=38806&r1=38805&r2=38806&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Lexer.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Lexer.h Wed Jul 11 11:24:48 2007
@@ -16,6 +16,7 @@
#include "clang/Lex/LexerToken.h"
#include "clang/Lex/MultipleIncludeOpt.h"
+#include "clang/Basic/LangOptions.h"
#include <string>
#include <vector>
@@ -25,33 +26,6 @@
class Preprocessor;
class SourceBuffer;
-struct LangOptions {
- unsigned Trigraphs : 1; // Trigraphs in source files.
- unsigned BCPLComment : 1; // BCPL-style // comments.
- unsigned DollarIdents : 1; // '$' allowed in identifiers.
- unsigned Digraphs : 1; // When added to C? C99?
- unsigned HexFloats : 1; // C99 Hexadecimal float constants.
- unsigned C99 : 1; // C99 Support
- unsigned Microsoft : 1; // Microsoft extensions.
- unsigned CPlusPlus : 1; // C++ Support
- unsigned CPPMinMax : 1; // C++ <?=, >?= tokens.
- unsigned NoExtensions : 1; // All extensions are disabled, strict mode.
-
- unsigned ObjC1 : 1; // Objective C 1 support enabled.
- unsigned ObjC2 : 1; // Objective C 2 support enabled.
-
- unsigned KeepComments : 1; // Keep comments ("-C") mode.
- unsigned KeepMacroComments : 1; // Keep macro-exp comments ("-CC") mode.
-
- LangOptions() {
- Trigraphs = BCPLComment = DollarIdents = Digraphs = ObjC1 = ObjC2 = 0;
- C99 = Microsoft = CPlusPlus = CPPMinMax = NoExtensions = 0;
- KeepComments = KeepMacroComments = 0;
- }
-};
-
-
-
/// Lexer - This provides a simple interface that turns a text buffer into a
/// stream of tokens. This provides no support for file reading or buffering,
/// or buffering/seeking of tokens, only forward lexing is supported. It relies
More information about the cfe-commits
mailing list