/// LookupTypeForExtension - Return the default language type to use for the
/// given extension.
- virtual types::ID LookupTypeForExtension(const char *Ext) const;
+ virtual types::ID LookupTypeForExtension(StringRef Ext) const;
/// IsBlocksDefault - Does this tool chain enable -fblocks by default.
virtual bool IsBlocksDefault() const { return false; }
#include "clang/Driver/Phases.h"
#include "llvm/ADT/SmallVector.h"
+namespace llvm {
+class StringRef;
+}
namespace clang {
namespace driver {
namespace types {
/// lookupTypeForExtension - Lookup the type to use for the file
/// extension \p Ext.
- ID lookupTypeForExtension(const char *Ext);
+ ID lookupTypeForExtension(llvm::StringRef Ext);
/// lookupTypeForTypSpecifier - Lookup the type to use for a user
/// specified type name.
return GetProgramPath(DefaultLinker);
}
-types::ID ToolChain::LookupTypeForExtension(const char *Ext) const {
+types::ID ToolChain::LookupTypeForExtension(StringRef Ext) const {
return types::lookupTypeForExtension(Ext);
}
Darwin::Darwin(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
: MachO(D, Triple, Args), TargetInitialized(false) {}
-types::ID MachO::LookupTypeForExtension(const char *Ext) const {
+types::ID MachO::LookupTypeForExtension(StringRef Ext) const {
types::ID Ty = types::lookupTypeForExtension(Ext);
// Darwin always preprocesses assembly files (unless -x is used explicitly).
/// @name ToolChain Implementation
/// {
- types::ID LookupTypeForExtension(const char *Ext) const override;
+ types::ID LookupTypeForExtension(StringRef Ext) const override;
bool HasNativeLLVMSupport() const override;
}
}
-types::ID types::lookupTypeForExtension(const char *Ext) {
+types::ID types::lookupTypeForExtension(llvm::StringRef Ext) {
return llvm::StringSwitch<types::ID>(Ext)
.Case("c", TY_C)
.Case("C", TY_CXX)