aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/DiagnosticKinds.def13
-rw-r--r--include/clang/Basic/IdentifierTable.h16
-rw-r--r--include/clang/Basic/TargetInfo.h69
-rw-r--r--include/clang/Basic/TokenKinds.def5
-rw-r--r--include/clang/Lex/MacroInfo.h10
-rw-r--r--include/clang/Lex/Preprocessor.h3
6 files changed, 11 insertions, 105 deletions
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index bfc5aca031..97310a1f0b 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -20,19 +20,6 @@
// ERROR - Error, compilation will stop after parsing completes.
//===----------------------------------------------------------------------===//
-// Portability
-//===----------------------------------------------------------------------===//
-
-DIAG(port_target_macro_use, NOTE,
- "use of a target-specific macro, source is not 'portable'")
-
-DIAG(port_target_builtin_use, NOTE,
- "use of a target-specific builtin function, source is not 'portable'")
-
-DIAG(port_wchar_t, NOTE,
- "sizeof(wchar_t) varies between targets, source is not 'portable'")
-
-//===----------------------------------------------------------------------===//
// Lexer Diagnostics
//===----------------------------------------------------------------------===//
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index fa3143f656..f64fd6fda4 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -45,10 +45,8 @@ class IdentifierInfo {
bool HasMacro : 1; // True if there is a #define for this.
bool IsExtension : 1; // True if identifier is a lang extension.
bool IsPoisoned : 1; // True if identifier is poisoned.
- bool IsOtherTargetMacro : 1; // True if ident is macro on another target.
bool IsCPPOperatorKeyword : 1; // True if ident is a C++ operator keyword.
- bool IsNonPortableBuiltin : 1; // True if builtin varies across targets.
- // 4 bits left in 32-bit word.
+ // 6 bits left in 32-bit word.
void *FETokenInfo; // Managed by the language front-end.
IdentifierInfo(const IdentifierInfo&); // NONCOPYABLE.
void operator=(const IdentifierInfo&); // NONASSIGNABLE.
@@ -106,13 +104,6 @@ public:
assert(BuiltinID == ID && "ID too large for field!");
}
- /// isNonPortableBuiltin - Return true if this identifier corresponds to a
- /// builtin on some other target, but isn't one on this target, or if it is on
- /// the target but not on another, or if it is on both but it differs somehow
- /// in behavior.
- bool isNonPortableBuiltin() const { return IsNonPortableBuiltin; }
- void setNonPortableBuiltin(bool Val) { IsNonPortableBuiltin = Val; }
-
/// get/setExtension - Initialize information about whether or not this
/// language token is an extension. This controls extension warnings, and is
/// only valid if a custom token ID is set.
@@ -126,11 +117,6 @@ public:
/// isPoisoned - Return true if this token has been poisoned.
bool isPoisoned() const { return IsPoisoned; }
- /// setIsOtherTargetMacro/isOtherTargetMacro control whether this identifier
- /// is seen as being a macro on some other target.
- void setIsOtherTargetMacro(bool Val = true) { IsOtherTargetMacro = Val; }
- bool isOtherTargetMacro() const { return IsOtherTargetMacro; }
-
/// isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether
/// this identifier is a C++ alternate representation of an operator.
void setIsCPlusPlusOperatorKeyword(bool Val = true)
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index 0550e51e82..16c959c6d0 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -29,33 +29,13 @@ class SourceManager;
namespace Builtin { struct Info; }
-/// TargetInfo - This class exposes information about the current target set.
-/// A target set consists of a primary target and zero or more secondary targets
-/// which are each represented by a TargetInfoImpl object. TargetInfo responds
-/// to various queries as though it were the primary target, but keeps track of,
-/// and warns about, the first query made of it that are contradictary among the
-/// targets it tracks. For example, if it contains a "PPC32" and "PPC64"
-/// target, it will warn the first time the size of the 'long' datatype is
-/// queried.
+/// TargetInfo - This class exposes information about the current target.
///
class TargetInfo {
/// Primary - This tracks the primary target in the target set.
///
- const TargetInfoImpl *PrimaryTarget;
+ const TargetInfoImpl *Target;
- /// SecondaryTargets - This tracks the set of secondary targets.
- ///
- std::vector<const TargetInfoImpl*> SecondaryTargets;
-
- /// Diag - If non-null, this object is used to report the first use of
- /// non-portable functionality in the translation unit.
- ///
- Diagnostic *Diag;
-
- /// NonPortable - This instance variable keeps track of whether or not the
- /// current translation unit is portable across the set of targets tracked.
- bool NonPortable;
-
/// These are all caches for target values.
unsigned WCharWidth, WCharAlign;
@@ -63,53 +43,22 @@ class TargetInfo {
// TargetInfo Construction.
//==----------------------------------------------------------------==/
- TargetInfo(const TargetInfoImpl *Primary, Diagnostic *D = 0) {
- PrimaryTarget = Primary;
- Diag = D;
- NonPortable = false;
+ TargetInfo(const TargetInfoImpl *TII) {
+ Target = TII;
// Initialize Cache values to uncomputed.
WCharWidth = 0;
}
- /// AddSecondaryTarget - Add a secondary target to the target set.
- void AddSecondaryTarget(const TargetInfoImpl *Secondary) {
- SecondaryTargets.push_back(Secondary);
- }
-
public:
- /// CreateTargetInfo - Create a TargetInfo object from a group of
- /// target triples. The first target triple is considered the primary
- /// target.
- static TargetInfo* CreateTargetInfo(const std::string* TriplesBeg,
- const std::string* TripledEnd,
- Diagnostic* Diags = NULL);
+ /// CreateTargetInfo - Return the target info object for the specified target
+ /// triple.
+ static TargetInfo* CreateTargetInfo(const std::string &Triple);
~TargetInfo();
- //==----------------------------------------------------------------==/
- // Accessors.
- //==----------------------------------------------------------------==/
-
- /// isNonPortable - Return true if the current translation unit has used a
- /// target property that is non-portable across the secondary targets.
- bool isNonPortable() const {
- return NonPortable;
- }
-
- /// isPortable - Return true if this translation unit is portable across the
- /// secondary targets so far.
- bool isPortable() const {
- return !NonPortable;
- }
-
///===---- Target property query methods --------------------------------===//
- /// DiagnoseNonPortability - Emit a diagnostic indicating that the current
- /// translation unit is non-portable due to a construct at the specified
- /// location. DiagKind indicates what went wrong.
- void DiagnoseNonPortability(FullSourceLoc Loc, unsigned DiagKind);
-
/// getTargetDefines - Appends the target-specific #define values for this
/// target set to the specified buffer.
void getTargetDefines(std::vector<char> &DefineBuffer);
@@ -197,8 +146,8 @@ public:
/// getTargetBuiltins - Return information about target-specific builtins for
/// the current primary target, and info about which builtins are non-portable
/// across the current set of primary and secondary targets.
- void getTargetBuiltins(const Builtin::Info *&Records, unsigned &NumRecords,
- std::vector<const char *> &NonPortableBuiltins) const;
+ void getTargetBuiltins(const Builtin::Info *&Records,
+ unsigned &NumRecords) const;
/// getVAListDeclaration - Return the declaration to use for
/// __builtin_va_list, which is target-specific.
diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def
index d4c9265146..9b636183dd 100644
--- a/include/clang/Basic/TokenKinds.def
+++ b/include/clang/Basic/TokenKinds.def
@@ -79,11 +79,6 @@ PPKEYWORD(sccs)
PPKEYWORD(assert)
PPKEYWORD(unassert)
-// clang extensions.
-PPKEYWORD(define_target)
-PPKEYWORD(define_other_target)
-
-
//===----------------------------------------------------------------------===//
// Language keywords.
//===----------------------------------------------------------------------===//
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h
index f690d955bd..c63b701a85 100644
--- a/include/clang/Lex/MacroInfo.h
+++ b/include/clang/Lex/MacroInfo.h
@@ -59,9 +59,6 @@ class MacroInfo {
/// it has not yet been redefined or undefined.
bool IsBuiltinMacro : 1;
- /// IsTargetSpecific - True if this is a target-specific macro defined with
- /// #define_target.
- bool IsTargetSpecific : 1;
private:
//===--------------------------------------------------------------------===//
// State that changes as the macro is used.
@@ -97,13 +94,6 @@ public:
IsBuiltinMacro = Val;
}
- /// setIsTargetSpecific - Set or clear the IsTargetSpecific flag.
- ///
- void setIsTargetSpecific(bool Val = true) {
- IsTargetSpecific = Val;
- }
- bool isTargetSpecific() const { return IsTargetSpecific; }
-
/// setIsUsed - Set the value of the IsUsed flag.
///
void setIsUsed(bool Val) {
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 1a8c2937ec..e18b40ac56 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -480,9 +480,8 @@ private:
void HandleImportDirective(Token &Tok);
// Macro handling.
- void HandleDefineDirective(Token &Tok, bool isTargetSpecific);
+ void HandleDefineDirective(Token &Tok);
void HandleUndefDirective(Token &Tok);
- void HandleDefineOtherTargetDirective(Token &Tok);
// HandleAssertDirective(Token &Tok);
// HandleUnassertDirective(Token &Tok);